User tests: Successful: Unsuccessful:
What has really bothered me for some time is that once you enable System - Page Cache
you have no control over which pages are being cached. For example, you might want not to cache a particular page. You can't do that unless you disable the plugin completely.
In the System - Page Cache
plugin parameters I've added two new fields:
Exclude Menu Items
. This is a multiple option dropdown that lists all of your menu items. You can select which menu items will not be cached.Exclude Pages
. This is just a <textarea>
that accepts regex patterns, each on a new line. I'm sure most people won't know how to use this but then again I'm sure they won't need to. It's also placed in the Advanced
tab, I hope not too many people find it :)I've made all efforts to ensure that this does not break current installations. By default these fields will be empty and will only be checked if they actually have contents.
After you create a few menu items, activate the plugin and select them from the list. They will no longer get cached.
The matches are performed against the path, including query and fragment (eg. /joomla/index.php?option=com_test&task=something#header
).
You can test by activating the plugin, creating some menu items and adding regular expressions to match them in the Exclude Pages
field. For example if you create a menu item called contact
and your URL will point to /joomla/index.php/contact
you can use \/contact\/?
as a pattern to exclude all pages that match /contact/
(that means that sub-menu items will be excluded as well).
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Labels |
Added:
?
|
Category | ⇒ | Language & Strings Plugins |
Easy | No | ⇒ | Yes |
Let's hope it gets accepted in its current state and then we'll have something to work with. If you want it to be accepted, just test and report back the results :)
IMO the options should be made the same globally for all plugins and not only for the cache plugin. Menu selection can be similar as with modules.
.. globally for all plugins
please no
Why not?
I don't see the benefit of having these options there? This is about the System - Page Cache plugin not having any parameters to ignore certain pages of your site from caching. As this plugin creates the cache, it only makes sense to add parameters to it instead of everywhere else.
There are some plugins where it might make sense to add some more options to limit what content they get triggered on, but I don't think it's appropriate for every plugin to have these types of options.
Probably it doesn't make sense to make it for all the plugins visible. But there should be an easy way to add the menu item selection functionality as a field in the plugin manifest file. The JPlugin class should take care if that parameter exists if the plugin is enabled or not, otherwise all the plugins do need to repeat that code if they are supporting menu based selection.
Perfect.
I have tested this item successfully on 063c0d1
No difference seen between before and after installation of patch
Status | Pending | ⇒ | Ready to Commit |
Labels |
I have tested this item successfully on 063c0d1
Tested successfully.
Joomla 3.4.5
Labels |
Added:
?
|
Milestone |
Added: |
Set Milestone to 3.5.0 as it can't be merged into staging according to SemVer.
I leave it to the 3.5 team to decide if it should be merged or not.
I am ok to merge this for 3.5 but want to see some changes first.
@OctavianC Can you make the following changes:
for the exclude area add the following attributes as the textarea is so small now, not very user-friendly.
class="input-xxlarge"
rows="15"
Extend the tooltip description on the exclude area. At this moment, I have no clue what to put into the textarea. Some examples would be good for users to understand what to type there. They won't be reading this PR :)
Thanks.
This PR has received new commits.
CC: @KingLouis1, @SiteOp, @svom
This PR has received new commits.
CC: @KingLouis1, @SiteOp, @svom
I've changed the label to Exclude URLs
(since it matches against URLs, not pages) and I've provided some examples in the description, but regex is a very broad topic and I can't summarize it in a tooltip... so if you have any improvements, feel free to post them :)
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-01 09:47:35 |
Closed_By | ⇒ | roland-d |
Will this be included in J 3.5 beta 1?
Labels |
Removed:
?
|
@JoshuaLewis yes.
I've made a similar PR 1514 long time ago. Perhaps you can inlcude the component option too? Would welcome a new feature like that.