I know how to set a basic expires HTTP response header in PHP as follows…
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
However, I want to make it a little more dynamic in that I want to, using PHP, specify an expiration time eight hours ahead of when the user accesses the content. Could someone help me achieve this?
Thanks in advance!
You can use Cache-Control’s max-age instead that indicated the number of second relative to the response time:
An example:
Note that if both Expires and Cache-Control’s max-age are present, max-age is preferred over Expires: