プロジェクト

全般

プロフィール

Vote #78060

完了

Browser js/css cache remains after upgrade

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
119
issue_org_id:
24617
author_id:
164030
assigned_to_id:
1
comments:
13
status_id:
5
tracker_id:
1
plus1:
2
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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:
http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/rails_asset_id

Redmine version is 3.3.1.devel.


journals

Good Job!!
Is it related that Redmine does not use asset pipeline?
--------------------------------------------------------------------------------
+1 Very good patch.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
When upgrading Redmine(2.x→3.x), the screen may collapse.
If you fix with this patch, I want you to merge quickly.
--------------------------------------------------------------------------------
Toshi MARUYAMA wrote:
> Good Job!!
> Is it related that Redmine does not use asset pipeline?

Ref: #13927#note-2
--------------------------------------------------------------------------------
@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

--------------------------------------------------------------------------------
Pavel Rosický wrote:
> @toshi - why is the asset pipeline disabled?

As #13927#note-3, we don't know how to *port* asset in plugins.

--------------------------------------------------------------------------------
h2. +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)

<pre>
#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).
</pre>

<pre>
View source in the browser and confirm that it has a parameter string.
(ex. ***.js.?1486805824)
</pre>

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Patch committed, thanks.
--------------------------------------------------------------------------------
Since the problem adversely affects web UI, I am setting category field to "UI".
--------------------------------------------------------------------------------
This patch doesn't seem to effect @@import url(../../../stylesheets/application.css);@ in themes, so I still have to add a Cache-Control header.

<pre>
<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>
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,29625,application.css imported by themes not covered by cache control versioning

Admin Redmine さんが3年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン3.4.0_119 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0