Bug #90406

Caching of pages is not adjusted for content with a specific "Publish Date"

Added by Sybille Peters about 2 months ago. Updated about 1 month ago.

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

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Content with a "Publish 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 about 1 month 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 about 1 month 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 about 1 month 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?

Also available in: Atom PDF