Questions tagged [responsecache]
28 questions
13
votes
3 answers
ASP.Net Core 2.0 - ResponseCaching Middleware - Not Caching on Server
I want to use server-side response caching (output cache) with asp.net core 2.0 and found out about Response Caching Middleware and wanted to give it a try with a brand new asp.core mvc project.
Here is the description from the link above which…

Engin
- 385
- 1
- 4
- 15
10
votes
1 answer
ASP.NET Core Response Caching Middleware - How to stop caching (500) error responses
I implemented ASP.NET Core Response Caching in my application to cache some API requests.
I have added the ResponseCaching middleware to the IServicesCollection in ConfigureServices method like this.
public void…

Thilina Sandunsiri
- 181
- 1
- 6
7
votes
1 answer
ASP.NET Core WebAPI: Memory Caching vs Response Caching
ASP.NET Core provides both in-memory caching and response caching.
Let's say that the app is ASP.NET Core WebAPI that brings data from SQL database to users with configured Responce Caching middleware.
In what case is it useful to use a memory…

AsValeO
- 2,859
- 3
- 27
- 64
4
votes
1 answer
Programmatically clear cache profile in asp.net core
I have setup a cache profile in my asp.net core web api as follows:
services.AddMvc(options => {
// Cache profile for lookup data will expire every 15 minutes.
options.CacheProfiles.Add("LookupData", new CacheProfile() { Duration = 15 }); …

Rob
- 6,819
- 17
- 71
- 131
3
votes
0 answers
.NetCore ResponseCache does not work for some routes
I call this action using Fiddler/Postman and in the first time it gets the response from the server side and the other requests from the cache, works!
[Route("Menu/GetSideBarMenuItems")]
[ResponseCache(Duration = oneWeek, VaryByQueryKeys =…

Offir
- 3,252
- 3
- 41
- 73
3
votes
1 answer
What's different between "ResponseCache attribute" and "ResponseCache middleware" in asp.net core?
I know ResponseCache attribute can caching page in client side by http headers attribute cache-control.
And ResponseCache middleware, it caching page on server (same http headers as ResponseCache attribute).
I compare these, it seems no different,…

Vic
- 758
- 2
- 15
- 31
3
votes
1 answer
How can I override [ResponseCache] attribute property later in the action method?
I have a [ResponseCache] attribute on an action method with the default cache Location = ResponseCacheLocation.Any. But in few cases only I want to override this property to ResponseCacheLocation.Client.
Is there a better way to override the…

Jonathan
- 1,276
- 10
- 35
3
votes
1 answer
How to pull a ViewComponent outside a response cached controller's action in ASP.NET Core
For performance purposes, I need to cache the results of the homepage action, while allowing the display name of the logged-in user to remain uncached.
I used to achieve something similar on ASP.NET MVC Framework projects using DonutOutputCache.…

Bidasse
- 43
- 5
2
votes
1 answer
ResponseCacheAttribute doesn't seem to stop preflight requests from hitting the server
I have the following attribute declaration over an action: [ResponseCache(Location = ResponseCacheLocation.Client, Duration = 1800)]
This works great - I can see the browser using disk cache instead of reading the information from the server again.…

user15716642
- 171
- 1
- 12
2
votes
1 answer
Saving the response cache to the server in Net 5
As in Net MVC, I want to save the response cache to the server (it's called outputcache), but there is no such feature in Net Core or Net 5. I couldn't find an alternative method. Thank you in advance.

Blackerback
- 47
- 4
2
votes
1 answer
ASP.NET Core ResponseCacheAttribute - VaryByCustom?
I've been using Microsoft.AspNetCore.Mvc.ResponseCacheAttribute for the first time and have come across an issue that I would have solved previously using the VaryByCustom property in OutputCachein ASP.NET (and using public override string…

ZippyZippedUp
- 458
- 5
- 14
2
votes
0 answers
Asp.net core response caching by country
I need to use use response caching for certain controller actions based on the country the request is coming from.
I have figured out how to get the country code from the request (it involves reading from a database, expensive, so I want to do this…

VMh
- 1,300
- 1
- 13
- 19
2
votes
1 answer
ResponseCache: GetVaryByCustomString for .net 5 or .net Core 1.0?
I am trying figure out how to implement GetVaryByCustomString function for asp.net core 1.0.
Have you implemented that kind of functionality for asp.net core 1.0?
Thanks

Barbaros Alp
- 6,405
- 8
- 47
- 61
1
vote
0 answers
caches.keys is empty, although there are cached endpoints
I have an ajax endpoint that is cached (devtools > network shows it as (disk cache) - top of the image)
Yet, when I try to list all cached endpoints in the browser, I get an empty array (bottom of the image)
caches.keys().then(function(keyList)…

Cătălin Rădoi
- 1,804
- 23
- 43
1
vote
0 answers
.Net 5 Custom Response Cache
Our old .Net framework APIs utilized the Strathweb.CacheOutput.WebApi2 which took care of server-side caching and set the appropriate client side headers in order to implement a form of output caching.
In that scheme, during project startup the…

Lee Z
- 802
- 2
- 13
- 39