Project

General

Profile

Actions

Bug #82828

open

stdWrap.cache doesn't use cached entries

Added by Julian Hofmann over 6 years ago. Updated over 6 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2017-10-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Tried to use stdWrap.cache on different instances (TYPO3 7.6.23 and 8.7.8) according to https://docs.typo3.org/typo3cms/TyposcriptReference/7.6/Functions/Cache/ But the content is rendered for each page instead of sharing it with other pages.

Also the exact example doesn't work:

page = PAGE
page.5 = TEXT
page.5 {
  stdWrap.cache.key = mycurrenttimestamp
  stdWrap.cache.tags = tag_a,tag_b,tag_c
  stdWrap.cache.lifetime = 3600
  stdWrap.data = date : U
  stdWrap.strftime = %H:%M:%S
}

Actions #1

Updated by Susanne Moog over 6 years ago

  • Status changed from New to Needs Feedback

Can you check if the following works for you:

page.10 = TEXT
page.10 {
  cache.key = mycurrenttimestamp
  cache.tags = tag_a,tag_b,tag_c
  cache.lifetime = 3600
  data = date : U
  strftime = %H:%M:%S
}

I think there is a documentation change missing since https://review.typo3.org/#/c/35915/15 was merged.

Actions #2

Updated by Julian Hofmann over 6 years ago

Thank you, your snippet works and I could solve my usecase.

But I think, it is not only a missing documentation change.
"cache" is currently documentated under "Function" (with wrong example), but also as Property of stdWrap (with link to cache function). So, the stdWrap.cache example should work, too. Or is there no cache-property in stdWrap anymore? But stdWrap.cache is writing to the cache (or at least stores the cache-identifiers) but doesn't get data from the cache.

Actions #3

Updated by Susanne Moog over 6 years ago

It does get data from the cache but due to the execution order of the stdWrap properties the data gotten from the cache gets overwritten by the subsequent stdWrap calls. If I understand the history correctly before the change the "cache get" stopped the execution of the subsequent calls while now the result from "cache get" gets set as value and is then used in further potential processing. I'm not sure which way is more / less correct or what the intended behaviour was. I'll try to figure it out.

Actions #4

Updated by Frans Saris over 6 years ago

Actions #5

Updated by Stefan Neufeind over 6 years ago

  • Category set to Documentation
  • Status changed from Needs Feedback to Accepted

So this makes it a documentation-issue then. Thanks - updated.

Actions #6

Updated by Julian Hofmann over 6 years ago

No, it is not just a documentation thing.

The breaking.rst says "``stdWrap.cache`` continues to exist and can be used as before." - this is not true. It is not working like before.
The break is discribed for cases where "you've previously used the ``cache.`` property in your custom cObject", not for normal (non-custom) cObjects.

Actions

Also available in: Atom PDF