-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client Side caching does not work for me. #45
Comments
The odd thing I see is that when I do request second time it does not include If-None-Match in header. I understand this might not be an issue and just a question! Please help |
Doing further research I found that when I manually hit request on Request URL:http://localhost/breeze/lfLookups server indeed returns 304 with no data. That is great. However the breeze.js I am using construct this request dynamically by adding querystring parameter to the request and it becomes like Request URL:http://localhost/breeze/lfLookups?_=1381488654430. The option that has been exposed ExcludeQueryStringFromCacheKey is set so I assume the querystring supplied here should not be an issue. But it don't work! It always returns context with code 200 (OK) |
there was a bug in ExcludeQueryStringFromCacheKey which is now fixed but not included in the latest nuget package yet. Do you mind building from latest source on Github and seeing if it works with that? |
OK I will try getting latest source. I see that when a querystring parameter changes the client browser do not passes If-None-Match:"VALUE" in request header causing fresh data transfer each time! |
I downloaded latest code and I still cannot get it working! Whenever I change the querystring paramter HTTP header assumes it as a separate resource and do not send If-None-Match:"VALUE" in request header! Is that something your code capable of handling? |
yes it's handled here https://github.com/filipw/AspNetWebApi-OutputCache/blob/master/src/WebAPI.OutputCache/DefaultCacheKeyGenerator.cs#L21 Also we have tests for that feature, which currently pass. Would you able to provide a small reproduction project? This would be the easiest way to solve this issue |
Thanks for your quick responses and sorry I won't be able provide you sample code at this point. what I have is huge and I might need you to give something simple. see what you can help |
Your querystring ignore code is OK. However we need to set something so that the browser request supplies If-None-Match:"VALUE" when a querystring applied to the request. I guess browser considers this as a separate resource and does not include this header? |
Coming very late in the game, but @pareshvarde, which browser were you using? |
I've copied dmalanij's code but it doesn't seem to be working on IE11 |
Hi, Below is the Decorator configuration, Below are the response header, |
Client Side caching does not work well in my case.
Attribute I used is
[CacheOutput(ServerTimeSpan=3600, ClientTimeSpan=3600, ExcludeQueryStringFromCacheKey=true)]
as per the document it should cache on client as well. Server caching indeed works great. if you look at attached image it does not fetch data from cache.
The text was updated successfully, but these errors were encountered: