Questions tagged [http-caching]

Eliminate the need to send HTTP requests in many cases, and eliminate the need to send full HTTP responses in other cases, by storing web content closer to where it is consumed.

491 questions
161
votes
9 answers

Is it possible to cache POST methods in HTTP?

With very simple caching semantics: if the parameters are the same (and the URL is the same, of course), then it's a hit. Is that possible? Recommended?
flybywire
  • 232,954
  • 184
  • 384
  • 491
142
votes
2 answers

Is it fine if first response is private with AppCache (Symfony2)?

I'm trying to use http caching. In my controller I'm setting a response as follows: $response->setPublic(); $response->setMaxAge(120); $response->setSharedMaxAge(120); $response->setLastModified($lastModifiedAt); dev mode In dev environment first…
Jakub Zalas
  • 33,992
  • 9
  • 84
  • 118
76
votes
7 answers

Prevent IE11 caching GET call in Angular 2

I have a rest endpoint that returns a list on a GET call. I also have a POST endpoint to add new items and a DELETE to remove them. This works in Firefox and Chrome, and the POST and DELETE work in IE11. However, the GET in IE11 only works on…
cmaynard
  • 2,691
  • 1
  • 20
  • 31
57
votes
4 answers

How to use caching in ASP.NET Web API?

I am using ASP.NET MVC 4 with WEB API I have the following action, in the action shown below, my service method makes a db call to DoMagic() method and returns an integer value which I am then using on every page, this action is called using an ajax…
Yasser Shaikh
  • 44,064
  • 44
  • 190
  • 271
56
votes
3 answers

What is the difference between no-cache and no-store in Cache-control?

I don't find get the practical difference between Cache-Control:no-store and Cache-Control:no-cache. As far as I know, no-store means that no cache device is allowed to cache that response. In the other hand, no-cache means that no cache device is…
vtortola
  • 32,045
  • 25
  • 144
  • 246
54
votes
4 answers

Setting HTTP cache control headers in Web API

What's the best way to set cache control headers for public caching servers in WebAPI? I'm not interested in OutputCache control on my server, I'm looking to control caching at the CDN side and beyond (I have individual API calls where the…
Moo
  • 8,964
  • 9
  • 49
  • 79
48
votes
3 answers

Expires vs max-age, which one takes priority if both are declared in a HTTP response?

If a HTTP response that returns both Expires and max-age indications which one is used? Cache-Control: max-age=3600 Expires: Tue, 15 May 2008 07:19:00 GMT Considering that each one refers to a different point in time.
vtortola
  • 32,045
  • 25
  • 144
  • 246
48
votes
5 answers

Output caching for an ApiController (MVC4 Web API)

I'm trying to cache the output of an ApiController method in Web API. Here's the controller code: public class TestController : ApiController { [OutputCache(Duration = 10, VaryByParam = "none", Location = OutputCacheLocation.Any)] public…
Samu Lang
  • 2,221
  • 2
  • 15
  • 32
43
votes
5 answers

Why does Chrome spend time "downloading" content from cache?

I am serving static content intended to be cached by the browser indefinitely. Chrome is caching it as expected, but is still spending time "downloading" it. I am using Chrome 46.0.2490.71. As you can see, the content is being served from cache,…
dlras2
  • 8,048
  • 5
  • 46
  • 89
30
votes
3 answers

Jekyll Bootstrap based blog - Expire headers?

I have a Jekyll bootstrap based blog hosted on Github pages. My problem is: Every time I change something on my web page, I have to forcefully reload the page (CTRL + R) to see the changes. Jekyll or my browser does not seem to realize that there is…
Sebastian Hoitz
  • 9,145
  • 13
  • 56
  • 74
20
votes
1 answer

HTTP: Combining expiration and validation caching

I'm having trouble formulating HTTP cache headers for the following situation. Our server has large data that changes perhaps a couple times a week. I want browsers to cache this data. Additionally, I want to minimize latency from conditional gets…
roufamatic
  • 17,295
  • 7
  • 53
  • 84
18
votes
3 answers

Cache-Control headers not sent in response despite being configured on response object

I'm trying to set cache headers in ASP.NET MVC Web API, but the response from IIS suggests that the CacheControl values set are being ignored. My original assumption was that I was using the EnableCorsAttribute in System.Web.Http.Cors, which is…
gb2d
  • 6,160
  • 8
  • 51
  • 97
17
votes
1 answer

What are the options for the gzip_proxied directive for?

The gzip_proxied directive allows for the following options (non-exhaustive): expired enables compression if a response header includes the “Expires” field with a value that disables caching; no-cache enables compression if a response header…
George Reith
  • 12,204
  • 16
  • 71
  • 141
17
votes
3 answers

How to use CXF, JAX-RS and HTTP Caching

The CXF documentation mentions caching as Advanced HTTP: CXF JAXRS provides support for a number of advanced HTTP features by handling If-Match, If-Modified-Since and ETags headers. JAXRS Request context object can be used to check the…
sfussenegger
  • 33,373
  • 14
  • 91
  • 117
16
votes
2 answers

HTTP Caching with Authorization

Given a response from a web server that contains an Authorization header as per the OAuth spec does HTTP caching fail to be useful? Request1 Authorization : AUTHTOKEN Request2 Authorization : ANOTHERAUTOTOKEN In this case given HTTP caching the…
Finglas
  • 15,050
  • 9
  • 51
  • 85
1
2 3
32 33