joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.4] Fix System - Page Cache plugin ignore Exclude URLs parameter

Open joomdonation opened this issue 1 year ago • 1 comments

Pull Request for Issue #42477.

Summary of Changes

There is a bug in System - Page Cache plugin causes Exclude URLs never works as explained in original issue. This PR just fixes that issue. Plus I change the code for checking URLs exclusion to use the same code like in Joomla 3 because:

  • It is easier to read
  • It is faster because it uses early return, so it not having to loop over all array elements.

Testing Instructions

  1. Uses Joomla 4.4
  2. Create a menu item to link to a Joomla article, set it's alias to something like test-page-cache-exclusion (this alias will will be configured in Exclude URLs parameter)
  3. Edit System - Page Cache plugin, look at Advanced tab, enter Alias of the menu item which you created above into Exclude URLs parameter. Make sure Status set to Enabled, save it.

Actual result BEFORE applying this Pull Request

The page is always being cached. To see that, you can access to that menu item for the first page. Then try to edit code in the file components/com_content/tmpl/article/default.php , add some random string to it. Then access to the menu item again, you do not see any change (because the system uses a cached version of the page)

Expected result AFTER applying this Pull Request

The page is not being cached as expected. To see that, you can access to that menu item for the first page. Then try to edit code in the file components/com_content/tmpl/article/default.php , add some random string to it. Then access to the menu item again, you will see the change you applied.

Link to documentations

Please select:

  • [x] No documentation changes for docs.joomla.org needed
  • [x] No documentation changes for manual.joomla.org needed

joomdonation avatar Feb 24 '24 08:02 joomdonation

I have tested this item :white_check_mark: successfully on 1deb3369633d7406d1342712d0ea85b4c71f2d1c


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

TLWebdesign avatar Feb 24 '24 12:02 TLWebdesign

I have tested this item :white_check_mark: successfully on eb2b1c415ba3207c940b6d73881aa1a9da46fc28


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

Hackwar avatar Feb 26 '24 10:02 Hackwar

RTC


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

Hackwar avatar Feb 26 '24 10:02 Hackwar

Thanks!

laoneo avatar Mar 04 '24 13:03 laoneo