Open Closed

Redis key is too long #6479


User avatar
0
dev@veek.vn created

Hello,

I have saved data to Redis using IDistributedCache, but the key in Redis is excessively long. How can I configure the prefix of the key?

Thanks, Veek

ABP Framework version: v.7.3.2 UI Type: Angular Database System: MongoDB Tiered (for MVC) or Auth Server Separated (for Angular): yes Exception message and full stack trace: Steps to reproduce the issue:

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    try to use CacheName on your cache item class.

    using Volo.Abp.Caching;
    
    namespace MyProject
    {
        [CacheName("Books")]
        public class BookCacheItem
        {
            public string Name { get; set; }
    
            public float Price { get; set; }
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    dev@veek.vn created

    got that for class.

    not sure for case string or list string. ex: private readonly IDistributedCache<Queue<string>, string> _cache;

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can create a class to wrap Queue. : )

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    dev@veek.vn created

    ok :))

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.