Take the community feedback survey now.
Take the community feedback survey now.
Hi
Caching is complex but I must ask what the goal is? To have 60 seconds static cache serving correct headers?
What I typically recommend is to use built in attributes in .net. In your scenarion it would probably look like this.
[OutputCache(PolicyName = "ProductPageCacheServer")]
[ResponseCache(CacheProfileName = "ProductPageCacheClient")]
public async Task<IActionResult> Index(ProductPageType currentPage)
{
// ...
}
Or do you have specific requirements for the code you've posted?
Hi Eric,
The issue is that the website is hosted on Azure DXP with only 2 GB of memory available. Because of this limited memory, the application is experiencing higher load and performance issues. Optimizely has suggested enabling caching to reduce memory consumption and improve response times.
We need to determine:
Which type of caching should be enabled,
How to configure it properly, and
What impact it will have on the existing website.
Our requirement is to set the cache duration dynamically on a per-page basis through a configuration page in Optimizely. Because the response cache attribute only accepts a static duration value, it will not work for our scenario where the duration must be dynamic.
Thanks,
Deepmala
HI,
I have written code for Response Cache custom cache attribute and decorate in controller page wise.
Everything is working fine values of cache reflecting property in network cache-control. Like cache duration value is for Home page i set 60 sec. then i would expect till to 60 sec page should display from cache but it is not happening.
Can anyone suggest how can i test this functionality?
Custom cache attribute
Custorm Attribute Decorate in controller on index method
[CustomCache(CacheType.HomePage)]
Thanks,
Deepmala