Created
March 11, 2015 15:25
-
-
Save pcalves/1818615afad4b5f3d5a8 to your computer and use it in GitHub Desktop.
Tells the server to ignore numbers in JavaScript and CSS file names (e.g. main.20150101.css), but the browser will still interpret it as a new file whenever the number is updated.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cache-busting via file name | |
# Filename example: | |
# <link rel="stylesheet" href="/css/main.20150310.css"> | |
# h/t Jeremy Keith (https://adactio.com/journal/8504) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.).(d).(js|css)$ $1.$3 [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment