Redmine - Defect #24617
Browser js/css cache remains after upgrade
2016-12-15 10:05 - Hiroshi Shirosaki

ステータス:

Closed

開始日:

優先度:

Normal

期日:担当者:

Jean-Philippe Lang

進捗率:0%

カテゴリ:

UI

予定工数:

0.00時間対象バージョン:3.4.0

Resolution:

Fixed

Affected version:

説明
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.
<script

src="/redmine/javascripts/application.js?1481777729"></script>

Attached patch is based on:
http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/rails̲asset̲idRedmine version is 3.3.1.devel.
関連するチケット:
関連している Redmine - Defect #29625: application.css imported ...

New

関係しているリビジョン
リビジョン 16448 - 2017-04-03 07:49 - Jean-Philippe Lang
Restore timestamp in asset paths (#24617).
Patch by Hiroshi Shirosaki.

履歴#1 - 2017-01-10 11:25 - Toshi MARUYAMAGood Job!!
Is it related that Redmine does not use asset pipeline?
#2 - 2017-01-20 19:56 - luigifab !
+1 Very good patch.
#3 - 2017-02-11 14:30 - Go MAEDA- 対象バージョン を 3.4.0 にセット
#4 - 2017-02-12 11:05 - Akipii Oga+1
When upgrading Redmine(2.x→3.x), the screen may collapse.
If you fix with this patch, I want you to merge quickly.
#5 - 2017-02-13 15:14 - Toshi MARUYAMA
Toshi MARUYAMA wrote:Good Job!!
Is it related that Redmine does not use asset pipeline?

Ref: #13927#note-2#6 - 2017-02-14 02:52 - Pavel Rosickýtoshio harita - why is the asset pipeline disabled?

2024-10-11

1/3

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#7 - 2017-02-14 03:07 - Toshi MARUYAMA
Pavel Rosický wrote:
toshio harita - why is the asset pipeline disabled?

As #13927#note-3, we don't know how to port asset in plugins.
#8 - 2017-02-20 04:23 - Kohei Nakamura+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,Upgrade succeeded.
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.
(Redmine 3.3.2)#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
Apache restart(Redmine Restart).

tmp:sessions:clear

View source in the browser(ex. ***.js.?1486805824)

andconfirm#9 - 2017-03-09 12:15 - Marius B

LTEANU

thatithasaparameter

string.

I didn't test the patch, but the functionality is really needed. Currently, we use a workaround with a pagespeed module for nginx in order to purge
the cache after a release with js/css changes.
#10 - 2017-04-03 07:50 - Jean-Philippe Lang- ステータス を New から Closed に変更- 担当者 を Jean-Philippe Lang にセット
- Resolution を Fixed にセット
Patch committed, thanks.
#11 - 2017-04-09 07:25 - Go MAEDA- カテゴリ を UI にセット
Since the problem adversely affects web UI, I am setting category field to "UI".
#12 - 2017-07-06 17:25 - Greg T
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"</IfModule><filesMatch "application\.css$"><ifModule mod̲headers.c>2024-10-11'^"((.*)-gzip)"$''"$1","$2"'

2/3

Header</ifModule></filesMatch>setCache-Control"max-age=60,must-revalidate"#13 - 2018-09-18 01:28 - Go MAEDA- 関連している Defect #29625: application.css imported by themes not covered by cache control versioning を追加

ファイル
0001-Adds-asset̲id-parameters-to-assets.patch

2024-10-11

2.25 KB

2016-12-15

Hiroshi Shirosaki

3/3