Browser js/css cache remains after upgrade
|Assignee:||Jean-Philippe Lang||% Done:|
Browser js/css cache remains after Redmine application upgrade.
Asset path parameter like "?1481777729" is not added with Rails 4.2.
Adding asset id parameters like old Rails 3 would solve the issue.
Attached patch is based on:
Redmine version is 3.3.1.devel.
#6 Updated by Pavel Rosický about 3 years ago
@toshi - why is the asset pipeline disabled?
btw. suffixes like "filename ?1481777729 " are just ignored and still cached by some web-servers.
http://guides.rubyonrails.org/asset_pipeline.html - using a file digest is safer then using timestamps
ex. https://redmine.org/assets/myasset- 66ca44f5c66abebe01f39e780e5b89159a04e7019c4515792224dd4cae962bbc .js
#8 Updated by Kohei Nakamura about 3 years ago
+1 Great Job!¶
I was also upgrading to Redmine 2.5.1 to 3.3.2, Redmine layout collapsed!
I did not understand the cause and attempted to cancel the version upgrade.
However, Go MAEDA taught me this patch,
I would like to apply the patch so that nobody suffers from this problem.
In my case, I applied this patch by the following procedure.
#cd redmine/config/initilizers #wget http://www.redmine.org/attachments/download/17275/0001-Adds-asset_id-parameters-to-assets.patch #patch -u < 0001-Adds-asset_id-parameters-to-assets. and input redmine/config/initializers/10-patches.rb #bundle exec rake tmp:cache:clear tmp:sessions:clear Apache restart(Redmine Restart).
View source in the browser and confirm that it has a parameter string. (ex. ***.js.?1486805824)
#12 Updated by Greg T over 2 years ago
This patch doesn't seem to effect
@import url(../../../stylesheets/application.css); in themes, so I still have to add a Cache-Control header.
<IfModule mod_deflate.c> # DeflateAlterETag NoChange RequestHeader edit "If-None-Match" '^"((.*)-gzip)"$' '"$1", "$2"' </IfModule> <filesMatch "application\.css$"> <ifModule mod_headers.c> Header set Cache-Control "max-age=60, must-revalidate" </ifModule> </filesMatch>