Giter Club home page Giter Club logo

Comments (11)

pareshvarde avatar pareshvarde commented on July 18, 2024

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.

pareshvarde avatar pareshvarde commented on July 18, 2024

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.

filipw avatar filipw commented on July 18, 2024

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.

pareshvarde avatar pareshvarde commented on July 18, 2024

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.

pareshvarde avatar pareshvarde commented on July 18, 2024

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.

filipw avatar filipw commented on July 18, 2024

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.

pareshvarde avatar pareshvarde commented on July 18, 2024

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.

pareshvarde avatar pareshvarde commented on July 18, 2024

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.

dmalanij avatar dmalanij commented on July 18, 2024

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.

Laoujin avatar Laoujin commented on July 18, 2024

I've copied dmalanij's code but it doesn't seem to be working on IE11

from strathweb.cacheoutput.

Krishna2988 avatar Krishna2988 commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.