Bug #90406

Caching of pages is not adjusted for content with "Publish Date" / "Expiration Date" (starttime, endtime)

Added by Sybille Peters 8 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2020-02-17
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
cache expiration starttime endtime
Complexity:
Is Regression:
Sprint Focus:

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

  1. 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)
  2. Render page (so cache is filled)
  3. 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

History

#1 Updated by Christian von Holten 8 months 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?

#2 Updated by Sybille Peters 8 months 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?

#3 Updated by Christian von Holten 8 months 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?

#4 Updated by Sybille Peters 3 months 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

#5 Updated by Sybille Peters 3 months ago

  • Related to Bug #91693: cache timeout calculation with custom starttime / endtime fields not working added

#6 Updated by Sybille Peters 3 months ago

  • Related to Bug #91561: Lifetime of cache is not properly computed for "Insert Records" CE added

#7 Updated by Sybille Peters 3 months 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

#8 Updated by Sybille Peters 3 months 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.

#9 Updated by Sybille Peters 3 months ago

  • Related to deleted (Bug #91561: Lifetime of cache is not properly computed for "Insert Records" CE)

#10 Updated by Sybille Peters 3 months ago

  • Related to deleted (Bug #91693: cache timeout calculation with custom starttime / endtime fields not working)

Also available in: Atom PDF