[MGNLCACHE-193] Increase expiration of browser cache policy Created: 14/Dec/17  Updated: 07/May/20  Resolved: 07/May/20

Status: Closed
Project: Cache Modules
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Pierre Sandrin Assignee: Unassigned
Resolution: Not an issue Votes: 1
Labels: quickwin
Remaining Estimate: 0d
Time Spent: 8m
Original Estimate: Not Specified

Attachments: JPEG File PageSpeed_Insights.jpg    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

The property 'expirationMinutes' is set to 60 for resources and 10 for default. This is very short and causes the browser to reload the files unnecessarily.

Google page insights rates this badly (see attachment) and suggests to set it to at least a week.
https://developers.google.com/speed/docs/insights/LeverageBrowserCaching

I suggest to increase the values in the default configuration to 10080 (one week).
Here:

  • /modules/cache/config/contentCaching/defaultPageCache/browserCachePolicy/policies/resources@expirationMinutes
  • /modules/cache/config/contentCaching/defaultPageCache/browserCachePolicy/policies/default@expirationMinutes

Test have shown that the files are served again from the server if they changed and the cache was cleared. So theres no need to keep the expiration low.



 Comments   
Comment by Pierre Sandrin [ 20/Dec/17 ]

I recognized that this does not work for normal resouces. If a resource changes the user would get the resource from the browser cache for a whole week without even checking if the file has changed. If we have resources that never change (I.E js-libraries, files with a hash in the filename) we rename them with a .cache. in the middle (I.E. myjs.cache.js or usd9asuda9hd.cache.js) and the far future policy of Magnolia sets the expiry to a year.
In other cases the default setting of 10 and 60 min. is fine.
This ticket can be closed.

Generated at Sun Feb 11 23:53:07 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.