I want to cache all my static content of mvc application.
I Added Web.config file like this in the Content folder
I got proper response header from my server.
Even after receiving the header with max-age attribute, The next Request to the server goes with Cache-Control: no-cache
This again retrieve the whole data.
It is not caching.
I want to know What am i missing here. Thanks in advance.
The no-cache in your screenshot is a request header not a response header.
It is likely being issued by your browser in response to you forcing a refresh (Control-F5). The browser is effectively saying 'please get me fresh data, I don't want the cached data'. The server-side can't control this - the client is the one making the request.
If you aren't forcing a refresh then you may have disabled your browser cache (e.g. https://stackoverflow.com/a/7000899/34092 ).
See also https://stackoverflow.com/a/14544664/34092 .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With