views:

118

answers:

1

For example, I want my static files to expire 7 days after they're first downloaded. What should I set the Expires header value to be?

+1  A: 

You need to do this server side. Generate the timestamp calculating the value, then send back the header with that value.

Example with PHP

header('Expires: ' . gmdate('D, d M Y H:i:s', strtotime("+7 days")));
Simone Carletti