Feature #41067
openClearing cache of "stdWrap.cache" entries stored in "cache_hash"
0%
Description
I was playing with the "stdWrap.cache" feature included in TYPO3 4.7. It is possible to tag cache entries, but there's now way to use the "TCEMAIN.clearCacheCmd = cachetag:<mytag>" to clean up the "cache_hash" table based on tags set by "stdWrap.cache" as this function operates on the "cache_pages" and "cache_pagesection" caches only.
See last comment at https://review.typo3.org/#/c/9266/ describing this situation.
It would be nice to have an option cleaning "cache_hash" entries based on tags using "TCEMAIN.clearCacheCmd".
Updated by Oliver Hader about 12 years ago
Fabrizio wrote:
Actually Christian is right. i only added this for feature completeness, but I can also be perfectly removed as we should never have to know anything about speficic cache_page identifiers.
@Philipp: The stdWrap.cache feature you're referring to (where you actuelly not only can but also must define the key/identifier) stores its content into cache_hash and not cache_pages. Cache_hash entries cannot be flushed by tag or removed by identifier inside clearCacheCMD anyways as this only operates on the page cache stored in cache_pages.
So if it feel cleaner to anybody, I'm perfectly ok with removing the clear by id feature (as long as the clear by tag feature stays:)
Updated by Oliver Hader about 12 years ago
I'm not sure if I got that right - but you'd like to flush the cache_hash by tag if somebody modified a particular page. And this action shall be triggered by the TSconfig TCEMAIN setting, right? Setting the cache happens in frontend, flushing then in backend - that's why I ask...
Updated by Oliver Hader about 12 years ago
- Status changed from New to Needs Feedback
- PHP Version set to 5.3
Updated by Arjen Hoekema about 12 years ago
I'm indeed trying to flush some cached (Frontend) blocks using Page TS Config. The blocks contain tt_news records throughout the website and the cache should be cleared when a backend user modifies news records. So I'd like to tag these "cache_hash" entries with a tag "news" and use something like "TCEMAIN.clearCacheCmd=cachetag:news" to remove the cached blocks.
It would be nice if the cache entries stored using "stdWrap.cache" could be removed somehow.
Updated by Viktor Livakivskyi about 12 years ago
I vote for this feature.
Simple use-case:
lib.common_content = CONTENT
lib.common_content {
table = tt_content
select {
pidInList = {$page.cc_id}
languageField = sys_language_uid
}
}
This TS fetches some CE records from specified page and shows them on every page of a website. Since I don't need to fetch these elements on every page, I'd like to fetch them once, store in cache and load them on every page from cache. That is easily achieved with stdWrap.cache.
If content at page uid={$page.cc_id} cahanges, I need to clear cache of lib.common_content to see the changed version on a website. From logical point of view, I must add stdWrap.cache.tag = common_content and put this into Page TS config: TCEMAIN.clearCacheCmd = cachetag:common_content.
But this won't clear my cache, because stdWrap.cache stores data in cache_hash, and TCEMAIN.clearCacheCmd tries to clear cache in cache_pages.
So, one of the following must be done:
- store cache of stdWrap.cache in cache_pages;
or
- clear cache of cache_hash as well via TCEMAIN.clearCacheCmd = cachetag:<tagname>
Updated by Alexander Opitz over 11 years ago
- Status changed from Needs Feedback to New
Updated by Mathias Schreiber almost 10 years ago
- Target version set to 7.2 (Frontend)
Updated by Benni Mack over 9 years ago
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Status changed from New to Accepted
- Target version changed from 7.5 to 8 LTS
Updated by Riccardo De Contardi over 7 years ago
- Target version changed from 8 LTS to 9.0
Updated by Susanne Moog almost 7 years ago
- Target version changed from 9.0 to Candidate for Major Version
Updated by Daniel Siepmann about 6 years ago
I've come to this as I encountered the following behaviour in 8.7 LTS and 9.5 LTS:
There is one page with an Extbase Plugin displaying a list of records with page uid 3 and a Storage Folder containing the records with uid 2.
Once someone edits a record via the Extbase plugin, Extbase will trigger a cache clearing of pages configured within the TSConfig of this storage page.
Extbase does not respect the configured tags at all. That's one further "bug" in this context. Also Extbase uses it's own implementation and coupling to cache manager instead of calling DataHandler as single point of truth, which supports tags.