? Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
7 Oct 2021

Summary of Changes

  1. Cache::setWorkarounds() incorrectly returns ALL current assets even if headerbefore option exists and a module/view didn't actually add any own assets.

This results in incremental caching of all assets in the cache of each module. Tons of WebAssets events are next executed on module cache load via Cache::getWorkarounds() and the load time is seriously affected.

  1. Iterating over $wa->getManagerState()['activeAssets'] does not requires checking the ASSET_STATE_ACTIVE state because this array holds only active assets

  2. The resulting array of getHeadData()['assetManager']['assets'] didn't have the asset name as key which prevents the fast cache workarounds comparison

Testing Instructions

Enable Joomla conservative caching, browse frontend pages as guest

Actual result BEFORE applying this Pull Request

Explore the contents of module cache files, see that they contain all WebAssetItem objects existing at the time of caching.
Note the cache file size.

Expected result AFTER applying this Pull Request

See that cache file size in much smaller now (delete old files first), see that the module cache now only have the assets really added by this module.

Documentation Changes Required

No.

2c12962 7 Oct 2021 avatar Denitz fix
avatar Denitz Denitz - open - 7 Oct 2021
avatar Denitz Denitz - change - 7 Oct 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Oct 2021
Category Libraries
avatar Fedik
Fedik - comment - 4 Dec 2021

I have tested this item successfully on 2c12962


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35776.

avatar Fedik Fedik - test_item - 4 Dec 2021 - Tested successfully
avatar chmst chmst - change - 31 Jan 2022
Labels Added: ?
avatar Denitz Denitz - change - 22 Feb 2022
Labels Added: ?
Removed: ?
avatar Denitz Denitz - change - 22 Feb 2022
Title
[4.0] Invalid caching of WebAssets
[4.1] Invalid caching of WebAssets
avatar Denitz Denitz - edited - 22 Feb 2022
avatar Denitz
Denitz - comment - 25 Feb 2022

Please check #37139 with better approach.

avatar richard67
richard67 - comment - 13 Mar 2022

Please check #37139 with better approach.

@Denitz Does that PR replace this one here? If so, this one here should be closed.

avatar Denitz Denitz - change - 14 Mar 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-03-14 05:45:21
Closed_By Denitz
avatar Denitz Denitz - close - 14 Mar 2022

Add a Comment

Login with GitHub to post a comment