Bug #20473

Starttime/endtime is not taken into account when caching

Added by Dmitry Dulepov over 12 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Category:
Caching
Target version:
-
Start date:
2011-06-05
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
TYPO3 Version:
4.6
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If a content element has a starttime/endtime or a tt_news item has such dates, they are not taken into account when cached.

The attached patch solves this issue in mostly automatic way.

The related issue is #19283 but it does not solve the problem automatically but requires hooks from extensions.
(issue imported from #M11145)


Files

cache_time.diff (4.43 KB) cache_time.diff Administrator Admin, 2009-05-19 10:09
cache_time_2.diff (5.03 KB) cache_time_2.diff Administrator Admin, 2009-05-27 20:50
11145_cache_time_v5.diff (6.55 KB) 11145_cache_time_v5.diff Administrator Admin, 2010-05-28 19:16

Subtasks

Bug #27227: Use Runtime Cache in tslib_fe::get_cache_timeoutClosed2011-06-05

Actions

Related issues

Related to TYPO3 Core - Feature #19283: page cache is not influenced by tt_content.starttime/endtimeClosed2008-09-03

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

Actions
#1

Updated by Martin Holtz over 12 years ago

i would like to have the method

setPageCacheExpiresTimestamp(...) from #19283 too.

So i would have the chance to reflact that issue in my extensions on my own. So i could take care of starttime/endtime automatically in my extensions without page-tsconfig settings. An editor would be able to put my plugin on every page without the need of additional configuration

regards,
martin

#2

Updated by Dmitry Dulepov over 12 years ago

Martin, please, discuss issue #19283 in that issue, not here.

#3

Updated by Dmitry Dulepov over 12 years ago

The second version of the patch adds caching for the calculated value and 'all' option for the cache configuration. This new option is useful when all pages depend on a record from some pages (for example, news are shown on each page of the site).

#4

Updated by Dmitry Dulepov over 11 years ago

Susanne, could you describe v5, please? What's the difference to my original versions?

#5

Updated by Zach Davis over 11 years ago

Looks like Susanne's patch takes into consideration the TS config property "cache_clearAtMidnight" whereas Dmitry's does not.

#6

Updated by Steffen Müller over 10 years ago

  • Target version deleted (0)

I'd like to pick this one up. The configuration in TypoScript would look like this:

The cache lifetime of page 42 considers the starttime/endtime of tt_news records from page 14:

config.cache.42 = tt_news:14

The cache lifetime of page 42 considers the starttime/endtime of tt_news from page 14 and tt_address records from page 15:

config.cache.42 = tt_news:14,tt_address:15

The cache lifetime of all pages consider the starttime/endtime of tt_news from page 14:

config.cache.all = tt_news:14

The cache lifetime of all pages consider the starttime/endtime of tt_news from page 14 and 16:

config.cache.all = tt_news:14,tt_news:16

#7

Updated by Mr. Hudson over 10 years ago

Patch set 1 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393

#8

Updated by Mr. Hudson over 10 years ago

Patch set 2 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393

#9

Updated by Steffen Müller over 10 years ago

How to test

1. Install phpmyadmin or keep mysql client ready.
2. Switch start/stop fields of fe_users from date to datetime in typo4conf/extTables.php

$GLOBALS['TCA']['fe_users']['columns']['starttime']['config']['eval'] = 'datetime';
$GLOBALS['TCA']['fe_users']['columns']['endtime']['config']['eval'] = 'datetime';

3. Create a page (uid=1) with content element.
4. Create another page (uid=2) with a fe_users record. Enter a datetime value in the stop field.
5. Add the following TypoScript to your root template:

config.cache.1 = fe_users:2

6. Render page 1 in a browser. Log off from the backend or use a second browser to create cache entry.
7. Check if there's a page cache item for the page in the cache_pages table.
7. Wait until datetime value from step 3. times out.
8. Repeat step 6.
9. Check again if the page cache item in the cache_pages table disappeared or changed.

#10

Updated by Mr. Hudson over 10 years ago

Patch set 3 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393

#11

Updated by Mr. Hudson over 10 years ago

Patch set 4 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393

#12

Updated by Steffen Müller over 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
#13

Updated by Steffen Gebert over 10 years ago

  • Assignee set to Steffen Gebert
  • Target version set to 1238
  • TYPO3 Version changed from 4.2 to 4.6
#14

Updated by Steffen Gebert over 10 years ago

I've just added an entry to the Pending Documentation page. Do you think this is descriptive enough?

#15

Updated by Xavier Perseguers over 10 years ago

I may have overread it but I don't find information whether stdWrap is supported (maybe partly) or not. It could make sense to have it for edge cases but having the information (yes|no) would be worth it I guess.

#16

Updated by Xavier Perseguers over 9 years ago

  • Status changed from Resolved to Closed
#17

Updated by Ernesto Baschny over 8 years ago

  • Target version deleted (1238)

Also available in: Atom PDF