Questions tagged [if-none-match]

HTTP request-header field used with a method to make it conditional. It allows efficient updates of cached information with a minimum amount of transaction overhead.

33 questions
16
votes
4 answers

ETag and If-None-Match HTTP Headers are not working

I have a file in my webserver and I am downloading that to my app everytime I access it because its possible that file content might be changed But If it is changed I would like to download that time only so bandwidth can be saved and fortunately…
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
11
votes
1 answer

Android OkHttp how to handle ETag

I'm try to do Android offline caching method using OkHttp. The flow is like this: I send an HTTP request with an ETag empty string at header field if-none-catched to the server, and the server returns a proper ETag. Then I store the ETag and…
cloud
  • 173
  • 1
  • 2
  • 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
5
votes
0 answers

Does ETag invalidate the Cache-Control header?

I am fetching a resource from my RESTful web service, and in the response I add these two headers: Cache-Control: public, max-age=120 ETag: "3D03F8066015A1438532E049AE5E16EA" The first time the browser got this response it cached it correctly for 2…
Matias Cicero
  • 25,439
  • 13
  • 82
  • 154
4
votes
1 answer

Does if-no-match need to be set programmatically in ajax request, if server sends Etag

My question is pretty simple. Although while searching over, I have not found a simple satisfying answer. I am using Jquery ajax request to get the data from a server. Server hosts a rest API that sets the Etag and Cach-control headers to the GET…
Irshad
  • 1,016
  • 11
  • 30
4
votes
2 answers

Does If-None-Match header overrules Cache-Control: max-age?

I have a webapp that serves an image: I'm clearly setting the Cache-Control header properly, and the web server is setting the Etag. The problem is that the resources is being If-None-Matched every single time effectively ignoring the Cache-Control…
Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
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

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

Micronaut ETag headers getting stripped off with HTTPS

We have enabled https in our micronaut application. Controller file is as below package http.caching.controllers import io.micronaut.core.async.publisher.Publishers import io.micronaut.http.HttpHeaders import…
Shivani Bhansali
  • 109
  • 1
  • 12
2
votes
1 answer

Is there much advantage of using Etag in HTTP?

When I looked at Flask(werkzeug) source codes around etag, I found that it generates a response object, generates etag from the data by sha1, compares it with the if-none-match etag of the request, and returns 304 or 200. So the process of accessing…
2
votes
1 answer

scalaj etag get can't parse

Using scalaj.http 2.4 I cannot get the correct code for a If-None-Match etag for this simple call: import scalaj.http.Http object EtagTest extends App {   val firstResponse = Http("https://api.github.com/users/octocat/orgs") // get correct etag…
Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
2
votes
1 answer

ETag with Accept-Language

I have a web service which puts an ETag on to each response so future calls can make use of the HTTP 304 (Not Modified) status. The ETag I generate really just a Base64 encoding of the query type along with the timestamp. The problem I have is if…
Agent96
  • 445
  • 1
  • 5
  • 20
2
votes
0 answers

OkHttp If-None-Match header is missing

I'm creating an Android app in which I use OkHttp networking library as an HTTP client. I share a single OkHttpClientinstance with a cache size of 10 MB. The flow is: I send a request to a server, the server handles it and produces the ETag header,…
mars885
  • 73
  • 3
  • 9
2
votes
0 answers

Why does the request.META does not include "HTTP-IF-NONE-MATCH" when I have set the ETAG in the response in Django?

The code of the response is as below: response=HttpResponse("hello") response["ETag"] = "4526A5E1A79DE447F21500A0E43B301A" return response There is not any information about IF-NONE-MATCH in the next request.META. Can someone tell me why and how?
djskl
  • 21
  • 2
2
votes
1 answer

If-None-Match: *

RFC2616 Sec 14 "14.26 If-None-Match" The meaning of "If-None-Match: *" is that the method MUST NOT be performed if the representation selected by the origin server ... exists, and SHOULD be performed if the representation does not exist. This…
Eric D
  • 23
  • 2
1
2 3