Thomas Löffler
Thomas Löffler

Reputation: 6144

How can I clear the cache if a page is published or expired

Behaviour:

What I want to have:

Clear cache of the home page if one of the sub pages is published or expired

What I tried:

TypoScript config.cache.all = pages:<parent-id-of-subpages>

It didn't work. The page does not appear in the listing after publish date. No workspaces are used.

Upvotes: 0

Views: 386

Answers (1)

Paul Beck
Paul Beck

Reputation: 2685

I think you probably don't have to take care about this, as long as you did not enable config.sendCacheHeaders in Typoscript which will cause the website visitors to store the pages cached locally. The TYPO3 caching mechanics are very clever and I think they take care of publish dates in records - escpecially pages.

UPDATE

I did a quick test in 9 LTS to verify my expectations. Indeed you have to configure the config.cache.all = pages:<parent-id-of-subpages> to make the cache automatically clean on start / stopdate of other pages. This works for me and pages will automatically hide or showup in the menues whenever their times has come without manually clearing any cache. But you really have to setup this Typoscript, otherwise the pages will stay cached.

TCEMAIN.clearCacheCmd is not a solution here because this will only trigger page caches to be deleted when a backend users does something in the backend. This it why it belongs to the PageTSConfig (Backend) section and not to the Pages Typoscript Setup Template (Frontend).

Why does it not work for you? I guess it must be config.sendCacheHeaders which should be set to 0 or you may pass any other lifetime of your page cache in the headers... maybe through the htaccess mod_expires? Use an incognito window of your browser and check the Networks when loading the page. Check the headers send with the request for any caching informations.

Upvotes: 1

Related Questions