Mastering Nginx

(Ron) #1
Chapter 7

[ 167 ]

To see how this configuration sets the headers, let's take a look at what each location


looks like in the browser. Each modern browser has a tool either built-in or available
as a plug-in that enables you to view the headers of both the request and the response.


The following series of screenshots show how Chrome displays the response headers
for these locations:



  • The main page (index.html): The Expires header is set to 5 minutes later
    than the Date header. The Cache-Control header has a max-age parameter
    set to 300 seconds.

  • A CSS file: The Expires header is set to 24 hours later than the Date header.
    The Cache-Control header has a max-age parameter of 86400 seconds.

Free download pdf