Questions tagged [etag]

ETag is an HTTP Entity Tag. Use this tag if you have a question about HTTP requests using ETag, If-Match or If-None-Match headers, or the generation and comparison of ETag values.

An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. If the resource content at that URL ever changes, a new and different ETag is assigned. Used in this manner ETags are similar to fingerprints, and they can be quickly compared to determine if two versions of a resource are the same or not.

http://en.wikipedia.org/wiki/HTTP_ETag

624 questions
11
votes
1 answer

IE 9+ ignores ETag value change and returns cached response

The Etag provided cache validation that works well with FF & chrome, but IE seems to ignore the Etag value and always returns the cached response. The server response is: HTTP/1.1 200 OK Date: Mon, 07 Jul 2014 06:01:57 GMT Content-Type:…
Yaniv Levi
  • 456
  • 6
  • 8
11
votes
1 answer

Leveraging etags and chunked encoding at the same time?

updated question How can my application leverage etags, and does introducing streaming/chunked encoding introduce any complications? original question When doing HTTP streaming with Transfer-Encoding: chunked, Content-Length can't be sent because…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
11
votes
4 answers

How to use shell magic to create a recursive etags using GNU etags?

The standard GNU etags does not support a recursive walk of directories as done by exuberant ctags -R. If I only have access to the GNU etags, how can I use bash shell magic to get etags to produce a TAGS table for all the C++ files *.cpp and *.h…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
10
votes
1 answer

304 Not Modified When If-None-Match is valid

I am optimizing an Express JSON API for consumption by iOS & Android Apps and do not seem to be able to get Express to respond with the correct 304 header when the Apps specify an etag within the If-None-Match header. I needn't setup Etag generation…
Illizian
  • 484
  • 1
  • 5
  • 13
10
votes
1 answer

Caching/Etag for Static Action in Rails 4

Since Rails 4 removed page caching and action caching, I'm wondering what is the Rails 4 way to cache an action that has no variables and has only html in the view? Should I fragment cache the static html in the view? How do I set an etag/fresh_when…
John
  • 4,362
  • 5
  • 32
  • 50
10
votes
1 answer

GitHub raw files - Etag algorithm

Does anyone know how the GitHub ETag when accessing raw content is generated? As far as I can tell this is not MD5, SHA1 or any common SHA variant; Example http headers: HTTP/1.1 200 OK Server: nginx/1.0.13 Date: Tue, 05 Jun 2012 19:46:08…
Ishan
  • 325
  • 2
  • 9
10
votes
1 answer

IE9 fakes 304 after receiving ETag

I've got a problem with AJAX & Internet Explorer 9: it stops polling our server after receiving response to initial etagged GET. It pretends to issue requests with response like "Response HTTP/1.1 304 Not Modified, Status 200 OK" (yes, two different…
9
votes
3 answers

Rails - etags vs. page caching (file cache)

What would be some advantages of using etags/stale?/fresh_when? instead of page caching (on a file cache)? Apache automatically handles etags for static files, but even if it didn't, page caching would still be better since the Rails app doesn't…
Ivan
  • 97,549
  • 17
  • 50
  • 58
9
votes
2 answers

Are browsers supposed to handle 304 responses automagically?

Might be a silly question, but I haven't found any clear answer yet. My server handles ETag caching for some quite big JSON responses we have, returning 304 NOT MODIFIED with an empty body if the If-None-Match header contains the same hash as the…
sp00m
  • 47,968
  • 31
  • 142
  • 252
9
votes
4 answers

How to configure ETag with browser caching

I’ve setup a browser cache for a static site via the .htaccess file by setting: # BROWER CACHING - 1 Day for images Header set Cache-Control "max-age=86400, public" I’m fine with these images having…
sam
  • 9,486
  • 36
  • 109
  • 160
9
votes
2 answers

ETags and collections

Many REST APIs provide the ability to search for resources. For example, resources of type A may be fetched using the following HTTP request: GET /A?prop1={value1}&prop2={value2} I'm using optimistic locking and therefore would like to return a…
manash
  • 6,985
  • 12
  • 65
  • 125
9
votes
3 answers

Any reason not to use USE_ETAGS with CommonMiddleware in Django?

The only reason I can think of is that calculating ETag's might be expensive. If pages change very quickly, the browser's cache is likely to be invalidated by the ETag. In that case, calculating the ETag would be a waste of time. On the other hand,…
allyourcode
  • 21,871
  • 18
  • 78
  • 106
9
votes
6 answers

Ruby on Rails, how to disable/turn off ETag

Greetings, How do I turn off ETag(s) in Ruby on Rails v2.3.5 When I do a direct request to to the RoR/Mongrel an ETag header is present. TIA, -daniel
Daniel
  • 7,006
  • 7
  • 43
  • 49
9
votes
1 answer

Etags and last-modified over https SSL?

Is it possible to use HTTP caching for conditional GET requests over a secure HTTPS connection? I've got caching working over non-secure HTTP, but when I switch to HTTPS the browser stops sending if-none-match and if-modified-since headers, so the…
Philip Brocoum
  • 2,866
  • 2
  • 24
  • 25
9
votes
4 answers

Weak ETAGs in Rails?

What is the best way to tell rails to use weak instead of strong ETAGs when using methods fresh_when and stale?? The reason I ask is that nginx (correctly) removes strong ETAG headers from responses when on-the-fly gzipping is enabled.
KaptajnKold
  • 10,638
  • 10
  • 41
  • 56