Contentful logo

Contentful Community

Etag or Last-Modified headers

#1

Is there a way to have contentful assets (images, video, etc) set an Etag or Last-Modified header? This is required for reliable cache invalidation.

0 Likes

#2

If I do curl -I https://images.ctfassets.net/qi0g1jkijtdx/4ugWcBVv9mkCyIS8eyIu66/e25df9e15bd5c32d5d3c4b56941c9dae/contentful-logo-c-only.png it shows the etag set

HTTP/2 200 
content-type: image/png
content-length: 0
etag: "c899681083bd42ca8306b39fb699a70d"
cache-control: max-age=2592000
access-control-allow-origin: *
x-cloud-trace-context: bf8191274008649bbbc2f096a47ffac4
date: Tue, 01 May 2018 17:19:28 GMT
server: Google Frontend
x-cache: Miss from cloudfront
via: 1.1 5cdfd14c7719554685a42cee3314971b.cloudfront.net (CloudFront)
x-amz-cf-id: PmxYHJxIcDLrXKcKa_tKObMLH3O5Xv7Fp15Ap4InDRymd8w3AOC-3w==

If you aren’t seeing the etag set, can you share the link either here or via a support ticket?

0 Likes

#3

and if you really want the last-modified header then use assets.ctfassets.net for the domain and you’ll get something like this:

HTTP/2 200 
content-type: image/png
content-length: 6698
date: Tue, 01 May 2018 20:09:20 GMT
access-control-allow-origin: *
access-control-allow-methods: GET, HEAD
access-control-max-age: 86400
x-amz-replication-status: COMPLETED
last-modified: Thu, 10 Aug 2017 18:13:49 GMT
etag: "c899681083bd42ca8306b39fb699a70d"
cache-control: max-age=2592000
x-amz-version-id: t__Vzat0mLsfj1IhLESLajWqjlca0w9y
accept-ranges: bytes
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 394b826e79842e1873c65c96b5e0a59c.cloudfront.net (CloudFront)
x-amz-cf-id: 9mwMAJCfpAjkpAmduCM_NDsUQV3_j4z5DkAEW-HXlOdbOz3eSE8c4Q==
0 Likes