Forum
Broken Cache Busting Redirects in Perch Runway
I'm using Perch Runway
Recently I have been trying to set up a cache busting technique that Jay helpfully had documented here.
I have my .css and .js files being name using the timestamp of the file with success like so: /assets/css/style.min.1487201825.css redirects to /assets/css/style.min.css
However I find some of the Perch Runway Rewrites are stopping the Cache Busting Rewrite and my .css and .js fails to be applied to the site.
Firstly I remove the following lines from my .htaccess...
RewriteCond %{REQUEST_URI} !^/login
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /login/core/runway/start.php [L]
Secondly I visit /assets/css/style.min.1487201825.css I get successfully rewritten to /assets/css/style.min.css. Pasting the removed Runway lines back into the .htaccess file and refreshing the page loads the page with the correct styles. When the css and js files get updated the name is going to change and the files wont redirect alongside the Runway lines. Obviously that is not going to be a solution going forward...
What is happening and how do I fix this? Full code for .htaccess is below:
.htaccess file
# Perch Runway
RewriteEngine On
#Perch Runway
RewriteCond %{REQUEST_URI} !^/login
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /login/core/runway/start.php [L]
#The CSS and JS rewrite
RewriteRule (assets[/])([^.]*).min.+.(css|js)$ $1$2.min.$3
You probably want your CSS rule before the Runway rule.
Thanks Duncan,
Such a simple solution!
Excellent!