Nginx Cache | @ prefix example

Francis Daly francis at daoine.org
Thu May 17 07:14:09 UTC 2018


On Thu, May 17, 2018 at 12:50:10AM -0400, c0nw0nk wrote:

Hi there,

> Thank you for the response and useful information Francis incredibly
> helpful.

You're welcome.

> My webapp outputting the X-Accel-Expires header is PHP like so.
> 
> CODE:
> <?php
> echo(gmdate('D, d M Y H:i:s', 0) . ' GMT');
> ?>
> OUTPUT:
> Thu, 01 Jan 1970 00:00:00 GMT
> 
> The 0 would be replaced by the time function what is a UNIX time stamp.

A unix time stamp is "absolute time in seconds since Epoch".

That is: it is a single number, probably 10 digits long for anything
currently useful.

Right now, it is:

$ date +%s
1526540978

So if you want to set the expiry time of "in about an hour", you could
send a header of

  X-Accel-Expires: @1526544000

where that timestamp corresponds to

$ date -u -d @1526544000
Thu May 17 08:00:00 UTC 2018

The X-Accel-Expires header should have a single value: either digits,
or an @ followed by digits.

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list