From 48a1cd5a7c5467da7927a9c27af395eeeb2dbc2f Mon Sep 17 00:00:00 2001 From: Alessandro Vendruscolo Date: Sat, 21 Jul 2012 00:27:27 +0200 Subject: [PATCH] Add filename based cache busting --- nginx/nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 46087c5..40f624b 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -119,6 +119,16 @@ http { # Custom 404 page error_page 404 /404.html; + # Built-in filename-based cache busting + # https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L403 + # This will route all requests for /css/style.20120716.css to /css/style.css + # Read also this: github.com/h5bp/html5-boilerplate/wiki/cachebusting + # This is disabled by default, because it'd be better if you use the build + # script to manage the file names. + # location ~* (.+)\.(\d+)\.(js|css|png|jpg|jpeg|gif)$ { + # try_files $uri $1.$3; + # } + # No default expire rule. This config mirrors that of apache as outlined in the # html5-boilerplate .htaccess file. However, nginx applies rules by location, the apache rules # are defined by type. A concequence of this difference is that if you use no file extension in