Bug #90406
closedCaching of pages is not adjusted for content with "Publish Date" / "Expiration Date" (starttime, endtime)
0%
Description
Content with a "Publish date" or "Expiration Date" is not rendered correctly because of caching of page (content).
If the content has a "Publish date" that intersects with the cache duration, I would expect the cache duration to be adjusted (this one time).
Example:
Time of created content: Feb 17, 2020 - 14:00
Cache duration: 24 h (until Feb 18, 2020 - 14:00)
Publish time: Feb 17, 2020 - 14:05 - infinite
In this case, the content is not published until Feb 18 14:00 but it should be published Feb 17 14:05.
I would expect the cache duration to be adjusted accordingly, or maybe a warning to be issued.
For pages with a publish date, this would also influence the menu (of other pages), so I guess it is not so easy to get this right entirely.
Reproduce¶
- Create a page with a content element which should be published some time in the future (the time interval being less than current cache period)
- Render page (so cache is filled)
- Wait until "Publish date" passed and load page again
Actual result¶
The content with a "Publish date" is not displayed after the "publish date". The cache of the page must be flushed for it to be rendered.
Expected result¶
When reloading the page after the publish date came, the content should be displayed
Updated by Christian von Holten over 4 years ago
Hello,
we have got the same issue at hoster mittwald, but not at any other hoster we are using. @Sybille Peters : were are you hosting?
Updated by Sybille Peters over 4 years ago
@Christian von Holten
We host ourselves (university website).
Can you find out more, what is different on your hosters?
Question is, is it just the cache duration that is maybe shorter so the issue does not come up or is some mechanism established to adjust the cache for the pages with a publish date?
Updated by Christian von Holten over 4 years ago
Hello,
I found a problem when hemnu is used like this:
tt_content.menu_newslist =< lib.contentElement tt_content.menu_newslist { templateName = NewsList dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor 10 { special = updated special.value.field = pages special.mode = starttime special.limit = 4 as = news } } }
When starttime of a page is set in a future time and finaly this date passes by, then this page will not appear until you flush the whole typo3 cache. And I mean not only flushing frontend-cache. You have to flush all. I dont know if there is an extra cache for hmenus, but I found a little work around. Instead of the code above I am using:
tt_content.menu_newslist =< lib.contentElement tt_content.menu_newslist { templateName = NewsList dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 10 { table = pages orderBy = starttime DESC pidInList.field = pages as = news max = 4 } } }
Therefor I had to change some little things in the used fluid template. Because there is no {newsItem.link} oder {newsItem.title} anymore I changed it to {newsItem.data.title} and for the link I have used <f:link.page pageUid="{newsItem.data.uid}">{newsItem.data.title}</f:link.page>
Maybe someone can have a look for this strange and bad behaviour in HMENU Processor?
Updated by Sybille Peters over 4 years ago
- Subject changed from Caching of pages is not adjusted for content with a specific "Publish Date" to Caching of pages is not adjusted for content with "Publish Date" / "Expiration Date" (starttime, endtime)
- Description updated (diff)
- Tags set to cache expiration starttime endtime
Updated by Sybille Peters over 4 years ago
- Related to Bug #91693: cache timeout calculation with custom starttime / endtime fields not working added
Updated by Sybille Peters over 4 years ago
- Related to Bug #91561: Lifetime of cache is not properly computed for "Insert Records" CE added
Updated by Sybille Peters over 4 years ago
@Christian Can you open a separate issue for the HMENU issue? It seems to be related but is a different problem, I think.
My original problem was that the starttime / endtime (of content on same page) did not work at all - (I suspected due to page being cached). I will now try to reproduce this.
Looking in the code, it should actually work, so I should not be seing this problem see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getFirstTimeValueForRecord() as Xavier pointed out in #91561
Updated by Sybille Peters over 4 years ago
- Status changed from New to Closed
I can no longer reproduce my problem. If the starttime is before the usual cache expiry date, the cache expiration will be recalculated so that the content is published in time.
Updated by Sybille Peters over 4 years ago
- Related to deleted (Bug #91561: Lifetime of cache is not properly computed for "Insert Records" CE)
Updated by Sybille Peters over 4 years ago
- Related to deleted (Bug #91693: cache timeout calculation with custom starttime / endtime fields not working)