No Code Attached Yet bug
avatar Ruud68
Ruud68
16 Sep 2021

Steps to reproduce the issue

do not configure a Path to Cache Folder in Global config.
Joomla will now have 2 cache default folders: one for the front-end and one for the back-end.

When you (in the back-end) do a Purge Expired Cache the cache object will set the cache base to JPATH_CACHE

in the back-end JPATH_CACHE is defined as:
define('JPATH_CACHE', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'cache');

This means that ONLY the administrator cache is purged, and not the cache files created for the front-end rendering this function useless IMO.

Expected result

Purging Expired cache should purge BOTH administrator and site cache files

Actual result

Only Administrator cache is purged

System information (as much as possible)

Additional comments

Same for Joomla 4: Joomla 4 also nly purges administator cache and not site cache (from looking at the code)

avatar Ruud68 Ruud68 - open - 16 Sep 2021
avatar joomla-cms-bot joomla-cms-bot - change - 16 Sep 2021
Labels Added: No Code Attached Yet
Removed: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Sep 2021
avatar Ruud68 Ruud68 - edited - 16 Sep 2021
avatar Ruud68 Ruud68 - change - 16 Sep 2021
The description was changed
avatar Ruud68 Ruud68 - change - 16 Sep 2021
Title
[3.10] clear expired cache not (fully) working
[3.10|4.0] clear expired cache not (fully) working
avatar Ruud68 Ruud68 - edited - 16 Sep 2021
avatar brianteeman
brianteeman - comment - 17 Sep 2021

Looking at all my sites the only cache folder that contains cache is administrator/cache

image

avatar brianteeman
brianteeman - comment - 17 Sep 2021

if i remember correctly it used to be /cache but for new sites it was changed to administrator/cache

avatar Ruud68
Ruud68 - comment - 17 Sep 2021

Do you have a cache site location configured in global config? of not (empty) purging the cache from the back-end will purge administrator/cache where front-end cache will be in /cache

avatar PhilETaylor
PhilETaylor - comment - 17 Sep 2021

Both Joomla 4 and Joomla 3 (and 4.0-dev and 3.10-dev) distribute a /cache folder and the reporter is right in saying that folder should be cleared when Purge Expired Cache and Clear Cache is used.

avatar brianteeman
brianteeman - comment - 17 Sep 2021

Do you have a cache site location configured in global config?

No

avatar brianteeman
brianteeman - comment - 17 Sep 2021

Sorry @PhilETaylor is correct my brain wasnt working - I was looking at a site where cache wasn't actually enabled

In joomla 3 there is a selector for site or admin when clearing the cache
image

avatar Ruud68
Ruud68 - comment - 17 Sep 2021

Sorry, but the report states that it is about purging EXPIRED cache, not clearing cache (that is a different view)
clicking the [Clear Expired Cache] only clears administrator/cache when no cache path specified in config (as stated and explained with code snippet)
Both J3 and J4 are affected
image

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment