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
4
votes
4 answers

How to let the browser or PHP cache a fetch() request?

This is basically the opposite of fetch(), how do you make a non-cached request?. Let's say we have client-side:
Click me
and server-side in PHP:
Basj
  • 41,386
  • 99
  • 383
  • 673
4
votes
3 answers

caching css and javascript

Im having trouble with caching... Im using this php file with url rewriting to compress and cache css and js I was under the impression that if i changed/updated one of my files, that the browser would retrieve the updated file. But it doesnt unless…
tuurbo
  • 361
  • 5
  • 14
4
votes
1 answer

How is the minio etag generated

Does anyone know how the minio etag is generated when you PUT an object? Is it a hash of the file and can we use it to prevent uploading the same file twice? Many thanks!
Suemayah Eldursi
  • 305
  • 4
  • 12
4
votes
1 answer

How to send an etag or last modified while making a request with aiohttp session.get

I am loading multiple feed urls every minute I want to send a http get request, get 200 status code and full data if the data has changed since the last time I loaded it I want the http status code 304 and no response body if the data has not…
PirateApp
  • 5,433
  • 4
  • 57
  • 90
4
votes
1 answer

Rails fresh_when should include current user id in etag

I see many examples like this: def show @article = Article.find(params[:id]) fresh_when(@article) end However the page also contains information (like top navigation) about the logged in user. A user can: log in as user A visit the…
collimarco
  • 34,231
  • 36
  • 108
  • 142
4
votes
1 answer

ETags for user-specific resources

We are using ETag headers for conditional requests in our REST API. Some resources have different contents based on the current authenticated user (some users see more, some other less information). The ETag is currently computed on the "full"…
sithmein
  • 437
  • 3
  • 11
4
votes
1 answer

Why is the Nginx etag created from last-modified-time and content-length?

Nginx etag source etag->value.len = ngx_sprintf(etag->value.data, "\"%xT-%xO\"", r->headers_out.last_modified_time, r->headers_out.content_length_n) -…
junlin
  • 1,835
  • 2
  • 25
  • 38
4
votes
1 answer

ETags for server-side rendered pages that contain CSP nonce

I have a server-side-rendered React app and Node/Express so far were able to generate the correct, stable ETags, allowing for taking advantage of client-side caching. Additionally, generated HTML contains fragments of render-blocking…
4
votes
1 answer

Fetch: how to use etags?

I'm planning to use Etags to validate the edited item to avoid mid-air collisions (if the item has been modified by other processes or users in the DB). here is the plan: Client calls RESTful API, gets an Etag from header, stores it in the item…
Dmitry Fadeev
  • 2,073
  • 2
  • 12
  • 12
4
votes
0 answers

How does browser cache eviction work?

Let me take the worst scenario of browser resource caching I have configured a static resource(with big size) to be cached for long expire (say 1 yr) with the version, so it's get downloaded with each version update. Let's assume I have updated 500+…
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
4
votes
3 answers

If-None-Match header always null in asp.net core controller

I send a request with "If-None-Match" header by postman, but it's always null in controller. I'm using Asp.net core 1.1. Is there anything wrong with my code? Debug Code if (Request.Headers.ContainsKey("If-None-Match")) { var oldETag =…
Hung Quach
  • 2,079
  • 2
  • 17
  • 28
4
votes
1 answer

Python: HTTP caching using 'CacheControl` not working

I'm using python 3.6 with requests module for API consumption and CacheControl module for caching the API response. I'm using following code but cache does not seems to be working: import requests from cachecontrol import CacheControl sess =…
Faisal Khurshid
  • 1,869
  • 3
  • 21
  • 27
4
votes
1 answer

Spring's support for If-Match Header

Coming to HTTP conditional request, briefly, benefiting from the Etag and If-*, we can realize response cache(Etag+If-None-Match) and optimistic lock(Etag+If-Match). As I see, it's convenient to perform the response cache using Spring which provides…
Sunny
  • 181
  • 1
  • 7
4
votes
0 answers

eTag in android application

I’m making an android application that have an user with a profile image. The obstacle is that when the image is changed on the server side the image’s link remains the same and my app shows an old one. I asked server developer about it and he said…
4
votes
1 answer

Can somebody explain me what is the use of "etag" in django?

I am confused with the etag mechanism. If anyone could explain it, would be a big help