Bug #20473
closedStarttime/endtime is not taken into account when caching
100%
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
Updated by Martin Holtz over 15 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
Updated by Dmitry Dulepov over 15 years ago
Martin, please, discuss issue #19283 in that issue, not here.
Updated by Dmitry Dulepov over 15 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).
Updated by Dmitry Dulepov over 14 years ago
Susanne, could you describe v5, please? What's the difference to my original versions?
Updated by Zach Davis over 14 years ago
Looks like Susanne's patch takes into consideration the TS config property "cache_clearAtMidnight" whereas Dmitry's does not.
Updated by Steffen Müller over 13 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
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393
Updated by Mr. Hudson over 13 years ago
Patch set 2 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393
Updated by Steffen Müller over 13 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.
Updated by Mr. Hudson over 13 years ago
Patch set 3 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393
Updated by Mr. Hudson over 13 years ago
Patch set 4 of change I75479d193772905093f53fcd24299df849478fba has been pushed to the review server.
It is available at http://review.typo3.org/2393
Updated by Steffen Müller over 13 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset c759bf2150028279ea057735d22cf9ce3008b766.
Updated by Steffen Gebert over 13 years ago
- Assignee set to Steffen Gebert
- Target version set to 1238
- TYPO3 Version changed from 4.2 to 4.6
Updated by Steffen Gebert over 13 years ago
I've just added an entry to the Pending Documentation page. Do you think this is descriptive enough?
Updated by Xavier Perseguers over 13 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.
Updated by Xavier Perseguers almost 13 years ago
- Status changed from Resolved to Closed