Project

General

Profile

Actions

Feature #19283

closed

page cache is not influenced by tt_content.starttime/endtime

Added by Martin Holtz over 15 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-09-03
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

The actual caching meachanism works like that:

- page is generated
- expiredate is calculated (by clearAtMidNight or page caching config,
usually set to generating time + one day)
- if a page is requested, TYPO3 checks wether the cache is expired or the
page starttime/endtime should take effect.

So an content element has no influence on caching time.

If a page is cached at 2pm (with 24hours cache-expire) and there is a
content element with an starttime at 3pm on that day, that content element
will be visible first at 2pm the next day (when the page cache expires).

As an proof of concept i wrote an extension:
http://forge.typo3.org/projects/show/extension-cacheexpire

With that extension the expire-timestamp of the pagecache will be calculated based on starttime/endtime of all content elements on that page. Deleted, hidden, starttime, endtime and group-permissions are respected.

For different tables then tt_content it is possible to use an hook. With that extension i provide an very simple class which hooks in and takes care of tt_news elements (if there is a plugin on that page).

I made an patch of that extension for integrating into the core.
(issue imported from #M9284)


Files

tslib_class.tslib_fe.php_patch.txt (2.83 KB) tslib_class.tslib_fe.php_patch.txt Administrator Admin, 2008-09-03 22:34
9284.diff (5.76 KB) 9284.diff Administrator Admin, 2008-09-09 13:36
2008.10.16.tslib_class_fe.php_patch.diff (815 Bytes) 2008.10.16.tslib_class_fe.php_patch.diff Administrator Admin, 2008-10-16 21:55
2008.10.29.tslib_class_fe.php_patch.diff (1.37 KB) 2008.10.29.tslib_class_fe.php_patch.diff Administrator Admin, 2008-10-29 21:06
9284-revised.diff (1.44 KB) 9284-revised.diff Administrator Admin, 2008-11-28 20:25
T3X_xnews-0_0_0-z-200811282031.t3x (5.81 KB) T3X_xnews-0_0_0-z-200811282031.t3x Administrator Admin, 2008-11-28 20:31
T3X_overlays-0_2_0-dev-z-200811282031.t3x (40.2 KB) T3X_overlays-0_2_0-dev-z-200811282031.t3x Administrator Admin, 2008-11-28 20:32
9284-revisedv2.diff (3.29 KB) 9284-revisedv2.diff Administrator Admin, 2010-05-28 19:15

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #20473: Starttime/endtime is not taken into account when cachingClosedSteffen Gebert2011-06-05

Actions
Related to TYPO3 Core - Bug #23180: Starttime/endtime for pages and content is not taken into account when cachingRejected2010-07-14

Actions
Actions #1

Updated by Martin Holtz over 15 years ago

The new 9284.diff is from Ingo Renner in the core mailinglist

Actions #2

Updated by Martin Holtz over 15 years ago

another try:

i removed the hook and the sql-query and reduced this patch that it only reacts on

$GLOBALS['TSFE']->cacheExpires

Actions #3

Updated by Martin Holtz over 15 years ago

i uploaded another patch

this time with an additional function to set cacheExpires Timestamp

Actions #4

Updated by Francois Suter over 15 years ago

Attaching a corrected patch, as submitted in the core list

Actions #5

Updated by Francois Suter over 15 years ago

I have tested this patch with a quickly put together extension, which I am attaching here. The extension is called "xnews". It's a FE plugin that just gets the 10 latest records from the tt_news table (so you need tt_news installed too). There's no configuration at all. Just insert an instance of xnews on some page and display the page. You should a list of 10 news items plus an indication of when the next update should take place, i.e. when the cache will expire.

To test properly you obviously need to have at least 1 tt_news with a starttime in the future.

You can check if that matches the information stored in the cache_pages table.

The xnews extension actually relies on an (as yet) unpublished extension called "overlays" (and this is even a modified version just for testing this patch). So you need to install "overlays" too. "overlays" is used to simplify querying the DB in particular in a multilingual setup. In this case I added a method for simply getting all records in the future and calculating a precise expiry time for the cache.

Actions #6

Updated by Dmitry Dulepov almost 15 years ago

Please, see also #20473. It provides an automatic solution to this problem.

Actions #7

Updated by Martin Holtz almost 15 years ago

hi dmitry,

in my eyes
#20473
is an better approach.

Actions #8

Updated by Xavier Perseguers almost 13 years ago

  • Target version changed from 4.6.0 to 4.6.0-beta1
Actions #9

Updated by Stefan Neufeind almost 13 years ago

The functionality described in this issue-description is what #20473 (already commited now) offers. So I'd say we should close this one.

Actions #10

Updated by Christian Kuhn almost 13 years ago

  • Status changed from New to Closed

Solved with #20473

Actions #11

Updated by Ernesto Baschny almost 11 years ago

  • Target version deleted (4.6.0-beta1)
Actions

Also available in: Atom PDF