Questions tagged [expires-header]

a HTTP Response Entity Header Field that specifies the date and time after which a response should be considered stale

The Expires HTTP Response Entity Header Field specifies the date and time after which a response should be considered stale. The Expires value must be a date in HTTP-date format.

Example

Expires: Sun, 06 Nov 1994 08:49:37 GMT

Resources

Related Tages

116 questions
372
votes
8 answers

ETag vs Header Expires

I've looked around but haven't been able to figure out if I should use both an ETag and an Expires Header or one or the other. What I'm trying to do is make sure that my flash files (and other images and what not only get updated when there is a…
GeoffreyF67
  • 11,061
  • 11
  • 46
  • 56
53
votes
5 answers

Add Expires headers

Add Expires headers There are 21 static components without a far-future expiration date. http://static.doers.lk/examples-offline.css http://static.doers.lk/kendo.common.min.css http://static.doers.lk/kendo.default.min.css …
sami
  • 1,324
  • 3
  • 13
  • 19
52
votes
4 answers

Why is "Expires" 1981?

My CRON Job returned an error that CRON job did not work. In that this was there: Set-Cookie: PHPSESSID=2t2drultihqci4em15nbfmeb63; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0,…
footy
  • 5,803
  • 13
  • 48
  • 96
30
votes
6 answers

How to set expires headers to all images in a bucket in Amazon S3

We have around 10,000+ images in a bucket in Amazon S3, how can I set the expires header on all of the images in one go?
Abhishek Jain
  • 971
  • 3
  • 13
  • 18
26
votes
2 answers

Setting expire headers for fonts not working

I am using the below code in my .htaccess file to try and set the expire headers for some fonts, but upon checking my firefox cache and the expire header, the font is set to expire in about 12 hours from now; not the 1 year I am trying to set it…
Brett
  • 19,449
  • 54
  • 157
  • 290
23
votes
3 answers

How to get Gzip and Expires Header on a Rails 3.1.1 app on Heroku Cedar?

I'm running a Rails 3.1.1 application on Heroku Cedar. By default this stack doesn't Gzip and set Expires Headers on assets. There is some doc about that, but it's not very clear : http://devcenter.heroku.com/articles/http-routing Can somebody give…
Camille
  • 678
  • 6
  • 23
15
votes
3 answers

how to add expires header to favicon.ico in Node.js / Express

In Express I add expires headers to my static files like this app.use(function (req, res, next) { // static folder: css if (req.url.indexOf('/css/') === 0) { res.setHeader('Cache-Control', 'public, max-age=345600'); // 4 days …
ezmilhouse
  • 8,933
  • 7
  • 29
  • 38
8
votes
1 answer

nginx with expires on javascript files (dynamically generated by PHP)

I have a problem with expires headers on javascript files which are generated by PHP.. The website has two types of javascript files. One part is static javascript files and one part is dynamically generated by PHP. conf without expires headers Here…
clarkk
  • 27,151
  • 72
  • 200
  • 340
8
votes
1 answer

Caching with Play framework and Java

I am running an application with Play and Java, and I need to set up expiration date for various types of assets: images, css, javascript etc. I have the following in the conf/routes file: GET /assets/*file …
7
votes
1 answer

Caching and HTTP/2

I'm on a site running on HTTP/2 and I realized the following caching setup: cache-control:max-age=604800, private etag:W/"115-54e8a25e7b187" expires:Fri, 14 Jul 2017 11:39:45 GMT last-modified:Tue, 02 May 2017 13:02:11 GMT Some questions about this…
Evgeniy
  • 2,337
  • 2
  • 28
  • 68
7
votes
2 answers

Expires header for Facebook JS SDK and Google Analytics

We all know adding a far-future expiration date to static resources is a good practice to increase our websites' page load speed. So we've ensured it for all of our resources BUT the all-too-common Facebook JS SDK and Google Analytics don't do that…
Collector
  • 2,034
  • 4
  • 22
  • 39
7
votes
2 answers

Browser Won't Request Latest PDF from Server

I have a PDF on Windows Server IIS web server, where users request it with IE8/9/10 using HTTP call like this... http: // mydomain.com / somefolder / myFile.pdf First hit will download the file no problem. Problem: if admin updates the PDF, and…
7
votes
1 answer

MVC's HTTP Caching - Last-Modified response header always equals Date

I'm not fully understanding how .NET MVC's HTTP caching works because it doesn't seem like it's actually retrieving cached resource files. I'm thinking I need to add some additional code somewhere... First, let's take a look at how I've set up HTTP…
mellis481
  • 4,332
  • 12
  • 71
  • 118
7
votes
3 answers

PHP: header expires not working

My PHP code: $expires_date = date('D, j F Y H:i:s', strtotime('now + 10 years')) . ' GMT'; header("Expires: $expires_date"); header('Content-type: text/javascript'); echo 'hello world'; When I check the response headers, I see…
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
6
votes
2 answers

Adding Expires Headers and .htaccess

I'm trying to optimise a WordPress site of mine - Type & Music based on reports I've been getting from GTmetrix. One of the things I'm being advised to do is add expires headers and leverage browser caching. I may be wrong, but I assume these are…
lateralaus
  • 1,523
  • 3
  • 11
  • 11
1
2 3 4 5 6 7 8