Comments (11)
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
from strathweb.cacheoutput.
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)
from strathweb.cacheoutput.
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?
from strathweb.cacheoutput.
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!
from strathweb.cacheoutput.
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?
from strathweb.cacheoutput.
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
from strathweb.cacheoutput.
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
from strathweb.cacheoutput.
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?
from strathweb.cacheoutput.
Coming very late in the game, but @pareshvarde, which browser were you using?
I came across similar things regarding the cache handling done by IE (10 and above) and the browser not sending the if-none-match
header, while others (chrome, firefox) do it ok. Unfortunately couldn't find any helpful documentaion on why IE behaves how it does.
I found a workaround and will be sharing some code soon.
from strathweb.cacheoutput.
I've copied dmalanij's code but it doesn't seem to be working on IE11
from strathweb.cacheoutput.
Hi,
The client caching is not working, even after setting ClientTimeSpan still the request goes to server and will not get the response from browser cache without server round trip. I am using IE11 browser. Do we need to make any other changes for the client caching to work.
Below is the Decorator configuration,
[CacheOutput(ClientTimeSpan = 120, ServerTimeSpan =60, Private=true, ExcludeQueryStringFromCacheKey =true)]
Below are the response header,
Cache-Control: max-age=60, private
from strathweb.cacheoutput.
Related Issues (20)
- Custom CacheKeyGenerator not being used in some cases HOT 2
- Last-Modified / If-Modified-Since / 304 support with data-based timestamp?
- Pipeline issue on my method Attributes in web Api controller
- Return 412 Precondition Failed on PUT requests
- Does not add cache header to HTTP302 redirect responses
- Servertimespam
- Add method not populated
- set up a new CI pipeline
- Custom Headers gets lost in cached server response HOT 2
- Invalidate cache for certain query strings
- Nuget hasn't been updated in a while HOT 1
- Four cache keys on one request
- Invalidate cache outside request context. HOT 1
- Cache not working after deploy to server
- It is not possible to set cache timeout in milliseconds HOT 1
- Will there be a nuget release of this .net 5 version soon? HOT 1
- Fancy a tech bump?
- Problem with registrations
- Client-cached WebAPI response doesn't update when changing users, using PerUserCacheKeyGenerator
- 📢 This repo is no longer maintained 📢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strathweb.cacheoutput.