Feature #79053
closedPage cache tags not accessible from hooks
0%
Description
In class \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController, the $pageCacheTags attribute is protected. It is possible to add tags via "addCacheTags" method, but there is no getter, so it is not possible to read this value from hooks called in "generatePage_postProcessing".
Use cases :- Add cache tags to http headers for an external cache system like Varnish (contentPostProc-output hook)
- Use cache tags in search index to detect possible changes (pageIndexing hook)
Updated by Gerrit Code Review almost 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51013
Updated by Benjamin Franzke almost 8 years ago
As an alternative to the generatePage_postProcessing Hook you could hook into the caching framework and grab the cache tags (given as arguments to the hook), when the page content is written to cache.
Therefore the VariableFrontend has a hook "set", we're using that hook for the exact same usecase in our nginx cache extension:
https://github.com/qbus-agentur/nginx_cache/blob/2.0.0/ext_localconf.php#L16
https://github.com/qbus-agentur/nginx_cache/blob/2.0.0/Classes/Hooks/SetPageCacheHook.php#L41
..that should be applicable to an extension that does the same for varshish.
Updated by Michel Tremblay almost 8 years ago
Thank you for the tip about the VariableFrontend hook, I will give it a try.
Being able to get cache tags could still be useful in different situations.
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51013
Updated by Gerrit Code Review almost 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51013
Updated by Anja Leichsenring over 6 years ago
- Status changed from Under Review to New
Updated by Benni Mack over 5 years ago
- Related to Epic #88027: Properly handle Hooks/Signals and Events added
Updated by Benni Mack over 5 years ago
- Status changed from New to Closed
heyhey.
we introduced this in december with https://review.typo3.org/c/59022/
Hope that solves your issue! If not, feel free to ping me and we'll reopen the ticket.
Updated by Benni Mack over 5 years ago
- Related to Bug #87066: TSFE->pageCacheTags is missing in __get() and misses a getter added
Updated by Benni Mack over 5 years ago
- Related to deleted (Epic #88027: Properly handle Hooks/Signals and Events)