Project

General

Profile

Actions

Feature #79053

closed

Page cache tags not accessible from hooks

Added by Michel Tremblay over 7 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-12-20
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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)

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87066: TSFE->pageCacheTags is missing in __get() and misses a getterClosedDaniel Goerz2018-12-04

Actions
Actions #1

Updated by Gerrit Code Review over 7 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

Actions #2

Updated by Benjamin Franzke over 7 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.

Actions #3

Updated by Michel Tremblay over 7 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.

Actions #4

Updated by Gerrit Code Review about 7 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

Actions #5

Updated by Gerrit Code Review about 7 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

Actions #6

Updated by Anja Leichsenring almost 6 years ago

  • Status changed from Under Review to New
Actions #7

Updated by Benni Mack about 5 years ago

  • Related to Epic #88027: Properly handle Hooks/Signals and Events added
Actions #8

Updated by Benni Mack about 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.

Actions #9

Updated by Benni Mack about 5 years ago

  • Related to Bug #87066: TSFE->pageCacheTags is missing in __get() and misses a getter added
Actions #10

Updated by Benni Mack about 5 years ago

  • Related to deleted (Epic #88027: Properly handle Hooks/Signals and Events)
Actions

Also available in: Atom PDF