Base solution for your next web application
Open Closed

Read setting from database, not cache #8274


User avatar
0
samara081 created

Hi,

I need to read the lateset value of application setting, but i don't want to read from cash. i used SettingManager.GetSettingValue to get the value, however sometimes it data is outdated as the seeting has been changed from another server.

To solve this, i clread the cashe before getting the vlaue "_cachingAppService.ClearCache" but this needs mentainnace permissin to excute.

Is thier any to read the setting from database, not the cashe?

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @samara081,

    You can follow two approaches;

    1. You can create a domain service which clears the cache and use it instead of _cachingAppService.ClearCache.
    2. You can use redis cache so in that case, all instances uses the same cache and there will be no need to clear the cache, see https://aspnetboilerplate.com/Pages/Documents/Caching#redis-cache-integration
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    samara081 created

    Thanks ismcagdas

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)