How to clear page and component caching by a URL in Joomla 2.5.x?

by Tomasz Smykowski   Last Updated January 10, 2019 11:10 AM - source

There is a website made in Joomla 2.5.x. It has System Cache enabled. The website contains a component called com_magic that handles URLS like:

https://websiteurl.com/bikes?view=best
https://websiteurl.com/bikes?view=latest

System Cache timeout is set globally to 7 days. But the problem is with latest view. Each day a cron job fetched data from bike provider endpoint. It checks if there are new bikes. And if yes, it adds them to the database.

Unfortunately since system cache is set to 7 days, if a new bike occurs, the latest url does not display new bikes until the cache gets invalidated.

The cache for both page and component com_magic should be therefore cleared:

  1. Each day or
  2. When new bike becomes available

For URL:

https://websiteurl.com/bikes?view=latest
  • How to clear cache for above URL both for page cache and com_magic component cache programatically? Or:
  • How to change cache timeout for page and com_magic component for this URL to 1 day specifically? Or:
  • How to disable caching for this particular URL for page and com_magic component?

Important note: This is a question about backend Joomla cache. NOT about browser cache!

Tags : joomla-2.5


Answers 1


I'm not fully sure (in Joomla 2.5) but most probably you can set that too in Joomla backend extensions-> plugins->System - Page Cache -> Exclude Menu Items. If you have the bikes under a menu for example.

In the same plugin (at the same place), if there is an advanced tab in that plugin settings, you will find the Exclude URLs option too.

(This is how you can set the core cache plugin in Joomla 3.x but I think these options were already available in Joomla 2.5 too)

Zollie
Zollie
January 10, 2019 10:35 AM

Related Questions