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.

529 questions
16
votes
2 answers

Does "Empty Cache and Hard Reload" empty the entire cache or just parts relevant to the current site?

Does "Empty Cache and Hard Reload" in Chromium/Chrome empty the entire cache or just parts relevant to the current site? My inkling is that it empties absolutely all cached resources (as suggested in the comment to this answer). However, a…
Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
16
votes
3 answers

How to detect when XHR returns a cached resource?

I'm wondering if there is a way how to detect when a response is returned from a local cache? Is it possible? The solution should be general and work for unconditional requests. In this case, the response code is always 200 OK, but XHR returns a…
Filip
  • 3,002
  • 1
  • 26
  • 37
15
votes
1 answer

How to disable caching for all WebApi responses in order to avoid IE using (from cache) responses

I have a simple ASP.NET Core 2.2 Web Api controller: [ApiVersion("1.0")] [Route("api/[controller]")] [ApiController] public class TestScenariosController : Controller { [HttpGet("v2")] public ActionResult> GetAll() …
Liero
  • 25,216
  • 29
  • 151
  • 297
14
votes
2 answers

Cache in CDN but not in browser

I currently use Akamai as a CDN, but I noticed that the browser is also caching content. It's great that the browser caches images/css/js, but I would like to know if there is a way to not cache on the browser, but to cache in Akamai. Now, right…
Jorge Lopez
  • 141
  • 1
  • 1
  • 3
13
votes
5 answers

REST: Should I redirect to the version URL of an entity?

I am currently working on a REST service. This service has an entity which has different versions, similar to Wikipedia articles. Now I'm wondering what I should return if for GET /article/4711 Should I use a (temporary) redirect to the current…
sfussenegger
  • 35,575
  • 15
  • 95
  • 119
12
votes
2 answers

System.Net.Http.HttpClient Disable Caching (.Net Standart Project)

In my .NET Standard project I'm using System.Net.Http.HttpClient. How can I disable all caching (request caching especially) in HttpClient? If server sends responses with no cache header problem solves. But I want to make this on client side. I want…
Trax
  • 943
  • 2
  • 12
  • 30
12
votes
3 answers

How do I set Expires: header when using send_data

I have a method in my controller which uses send_data like this: def show expires_in 10.hours, :public => true send_data my_image_generator, :filename => "image.gif", :type => "image/gif" end Using expires_in results in headers being sent like…
conny
  • 9,973
  • 6
  • 38
  • 47
12
votes
3 answers

Is it necessary to append querystrings to images in an img tag and images in css to refresh cached items?

I know that a common practice is to set an expire time far in the future for css, javascript and image files and then make sure that all browsers fetches the latest content as soon the files changes by appending a querystring (or changing filename)…
Fredrik
  • 2,016
  • 3
  • 15
  • 26
11
votes
1 answer

What is the meaning of the HTTP header Vary:*

As far as I know, the HTTP Header Vary specifies a comma separated list of HTTP headers that need to be considered by caches together with the URL when deciding if a request is a cache hit or miss. If that header is omitted, means that only the URL…
vtortola
  • 34,709
  • 29
  • 161
  • 263
11
votes
2 answers

How does caching work in JAX-RS?

Suppose I have the following web service call using @GET method: @GET @Path(value = "/user/{id}") @Produces(MediaType.APPLICATION_JSON) public Response getUserCache(@PathParam("id") String id, @Context HttpHeaders headers) throws Exception { …
roxrook
  • 13,511
  • 40
  • 107
  • 156
11
votes
1 answer

Cache-Control: 'private' makes 'no-cache="set-cookie"' unnecessary?

My reading of the definition of the 'private' directive for the Cache-Control header is that it will prevent any part of the response from being cached by intermediate proxies. So based on that, it sounds like if I'm using the 'private' directive…
Philip Wilcox
  • 113
  • 1
  • 1
  • 6
10
votes
3 answers

ASP.NET Core - difference between Output caching and Response caching

ASP.NET Core 7 preview 6 just introduced Output caching which caches the endpoint output. However ASP.NET already has Response caching which seems to already provide the same feature. What is the difference between the two and when should one be…
Dalibor Čarapić
  • 2,792
  • 23
  • 38
10
votes
1 answer

What are React Native's caching behaviors for fetch

What currently are React Native's default behaviors for caching in fetch calls? The official FB guides simply say "look at Mozilla!" but we're not on a web browser. I would assume cache behavior is custom here as result of the middleware. Let's say…
ericjam
  • 1,501
  • 2
  • 20
  • 30
10
votes
2 answers

Difference between three .htaccess expire rules

What's the difference between the following three .htaccess rules and when to use each, is there any special use cases that prefers one over the other?: Header set Cache-Control "max-age=290304000" Header set Expires "Thu, 15 Apr 2020 20:00:00…
Omranic
  • 1,392
  • 3
  • 17
  • 32
10
votes
2 answers

If-None-Match and NSURLConnection

My server is setting the etag header element for caching support. iOS (6.1.4) application is using the native NSURLConnection class to send XML request to the server first time the server is sending the response with the etag set in the header If…
fvisticot
  • 7,936
  • 14
  • 49
  • 79
1
2
3
35 36