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
3
votes
0 answers

Caching responses in DRF

I have a REST API and some of the endpoints take a significant time to generate the responses, so I want to add some response caching and etag support. I have looked at the conditional response implementation in Django and at both response caching…
Mad Wombat
  • 14,490
  • 14
  • 73
  • 109
3
votes
1 answer

What does "subrange" mean in the HTTP spec?

See, for example, §13.3.3 and §13.3.4. It doesn't seem to me that this could be related to "media range" (§14.1, e.g. Accept: text/*), nor "language range" (§14.4, e.g. Accept-Language: da, en-gb;q=0.8, en;q=0.7). Maybe it's the "accept range"…
James A. Rosen
  • 64,193
  • 61
  • 179
  • 261
3
votes
1 answer

Is it possible to use ETag fully instead cookies for some web applications?

The use of cookies in web applications is extremely convenient and universal. But in some countries the law requires to place additional information on a website that uses cookies. To avoid this in the web application, I consider to use the ETags…
simhumileco
  • 31,877
  • 16
  • 137
  • 115
3
votes
1 answer

IIS7 ASP.NET MVC 2 Asset Caching Module Not Working

I have this HttpModule that I am using to remove unwanted headers and cache assets for about 30 days but it does not seem to work. Code and http response below: Response: Cache-Control private Content-Type text/html;…
Paul
  • 12,392
  • 4
  • 48
  • 58
3
votes
0 answers

Google Drive file etag in v3

I don't see ETag in Google Drive API v3. What to use for "if-match" header to detect conflict in v3?
surlac
  • 2,961
  • 2
  • 22
  • 31
3
votes
0 answers

Inconsistent ETags in YouTube API

I'm looking at building a caching layer on top of the YouTube API and making use of the HTTP standard ETag functionality to do this as described here https://developers.google.com/youtube/v3/getting-started#etags I've done some direct testing of…
David Geary
  • 1,756
  • 2
  • 14
  • 23
3
votes
1 answer

What is the best way to generate a ETag based on the timestamp of the resource

So in one of my projects i have to create a http cache to handle multiple API calls to the server. I read about this ETag header that can be used with a conditional GET to minimize server load and enact caching.. However i have a problem with…
Infamous
  • 744
  • 11
  • 25
3
votes
1 answer

REST - ETag when POST to collection of resources and If-Match header

Each user has a collection of gems. These gems can be accessed via a REST API: GET /user//gem -> get all gems GET /user//gem/ -> get an existing gem POST /user//gem -> add a…
3
votes
1 answer

How to use OkHttp's ETag and If-None-Match on android

I use OkHttpClient (v3.0.1) which is in my application,but ETag and If-None-Match are not working。 For example: First GET http://112.4.19.67/task/imags_avatar/20130607165126605.png In Response, I get ETag and Last-Modified. Request: GET…
3
votes
1 answer

emacs find-tag has trouble with .el.gz files

When I use find-tags, I get the following error: File: /Applications/Emacs.app/Contents/Contents/Resources/lisp/simple.el not found simple.el.gz exists and I built TAGS using (find . -name *.el && find . -name *.el.gz) | etags - I'm using the…
hiheelhottie
  • 927
  • 8
  • 10
3
votes
1 answer

apache httpclient and etag cache

I'm using Apache HttpClient 4.3.1 and I'm trying to integrate etag validation cache. I've tried to "drop in" httpclient-cache CachingHttpClientBuilder instead of my usual HttpClientBuilder using instructions in here, but that didn't seem to do any…
Ran Biron
  • 6,317
  • 5
  • 37
  • 67
3
votes
1 answer

When is an "if-none-match"-request sent?

While optimizing the caching-behaviour of our website, I noticed that a whole lot of if-none-match-requests are sent to our site. As far as I understand caching, this should not be the case as long as the cache is still valid. One particular request…
Andreas
  • 1,997
  • 21
  • 35
3
votes
2 answers

How to use @condition decorator for REST view classes

I am trying to use the ETAG HTTP header to send 304 NOT MODIFIED responses. The following code is used: class MyView(GenericAPIView): serializer_class = MySerializer @condition(etag_func=get_language_etag) def get(self, request, *args,…
David Schumann
  • 13,380
  • 9
  • 75
  • 96
3
votes
1 answer

ETag vs. date in If-Range HTTP header

According to RFC7233, an If-Range HTTP header can either be an entity-tag or an HTTP-date. In this context, section 3.2 of the RFC states A valid entity-tag can be distinguished from a valid HTTP-date by examining the first two characters for a…
jochen
  • 3,728
  • 2
  • 39
  • 49
3
votes
1 answer

NSURLCache and ETags with gzip enabled are not working

I am trying to get NSURLCache to work on iOS8, but it seems to be broken when using an ETag and gzip compression. I am using NGINX with gzip compression enabled as a proxy for a thin webserver. The following response is not getting cached by…
Lars K.
  • 31
  • 2