Bug #21481
Backend: Generated tumbnails can't cached in the clients browser
| Status: | Resolved | Start date: | 2009-11-06 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 100% |
|
| Category: | Caching | |||
| Target version: | - | |||
| TYPO3 Version: | 4.3 | Complexity: | ||
| PHP Version: | 5.2 | |||
| Votes: | 0 |
Description
Problem:
Thumbnails can not be cached by browser.
There is always the current timestamp appended to the thumbnail URL, IMHO that is not required because the thumbnails URL contains already a check sum ("t3lib_div::shortMD5()") based on the:
- $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']
- filename
- filetime
Solution:
- Remove the parameter "dummy=timestamp" from the URL
- The used md5 should be enlarged to full 32 char.
Note:
The tumbnails are cached well in the "typo3temp/" folder, that is based on an md5 sum.
The generated URL look like:
typo3/thumbs.php?&file=__ABSOLUTE_PATH_TO_FILE__&size=56x56&md5sum=d509bbc84d&dummy=1257502882
Global variable is set to the current time stamp:
typo3_src/t3lib/config_default.php:484:$EXEC_TIME = time();
Used:
=======================
t3lib/class.t3lib_befunc.php:1808: $url = $thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
t3lib/class.t3lib_befunc.php:1837: $url = $thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
ypo3/sysext/cms/tslib/class.tslib_content.php:4619: $icon = 't3lib/thumbs.php?dummy='.$GLOBALS['EXEC_TIME'].'&file='.rawurlencode('../'.$theFile).$thumbSize.$md5sum;
typo3/show_item.php:427: $url = $thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
typo3/class.file_list.inc:536: $href = $this->backPath.$this->thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
And a lot of more .....
(issue imported from #M12490)
Related issues
| related to Core - Feature #19713: Cache thumbnails shown in element browser | Closed | 2008-12-18 |
Associated revisions
[BUGFIX] Make generated thumbnails browser-cachable
Thumbnail generation code appends current timestamp in each
invocation of the thumbnail generation script. This is useless
because it prevents caching. Removing this timestamp will not
cause any issues with old vs new versions because the URL
includes an md5 checksum of the file size and file timestamp.
So when the file is updated, the md5 sum will change. The
patch also changes short md5 to full md5.
Additionally proper last-modified, expires and etag headers
are sent.
Change-Id: I852e6d8c4a2626c167fa4ea380874b46f17112ca
Fixes: #21481
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/6876
Tested-by: Tolleiv Nietsch
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Klee
Reviewed-by: Tolleiv Nietsch
Tested-by: Stefan Neufeind
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
[BUGFIX] Make generated thumbnails browser-cachable
Thumbnail generation code appends current timestamp in each
invocation of the thumbnail generation script. This is useless
because it prevents caching. Removing this timestamp will not
cause any issues with old vs new versions because the URL
includes an md5 checksum of the file size and file timestamp.
So when the file is updated, the md5 sum will change. The
patch also changes short md5 to full md5.
Additionally proper last-modified, expires and etag headers
are sent.
Change-Id: I852e6d8c4a2626c167fa4ea380874b46f17112ca
Fixes: #21481
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/9471
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
[BUGFIX] Make generated thumbnails browser-cachable
Thumbnail generation code appends current timestamp in each
invocation of the thumbnail generation script. This is useless
because it prevents caching. Removing this timestamp will not
cause any issues with old vs new versions because the URL
includes an md5 checksum of the file size and file timestamp.
So when the file is updated, the md5 sum will change. The
patch also changes short md5 to full md5.
Additionally proper last-modified, expires and etag headers
are sent.
Change-Id: Icb32ca8fbde91dffa65b835ac9c0954f3f5da53f
Fixes: #21481
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/12820
Reviewed-by: Philipp Gampe
Reviewed-by: Marcus Schwemer
Reviewed-by: Wouter Wolters
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
History
Updated by Mr. Jenkins over 1 year ago
- Status changed from New to Under Review
Patch set 1 of change I852e6d8c4a2626c167fa4ea380874b46f17112ca has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Dmitry Dulepov over 1 year ago
- Target version deleted (
0)
I abandoned my change in Gerrit because once again it went from review of the real fix to an abstract discussion and -1s based on that. Let somebody else fix bugs in the environment like this...
Updated by Dmitry Dulepov over 1 year ago
- Status changed from Under Review to New
Updated by Dmitry Dulepov over 1 year ago
- Status changed from New to Accepted
Updated by Gerrit Code Review over 1 year ago
- Status changed from Accepted to Under Review
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Gerrit Code Review over 1 year ago
Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Gerrit Code Review over 1 year ago
Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Gerrit Code Review over 1 year ago
Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Gerrit Code Review over 1 year ago
Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6876
Updated by Dmitry Dulepov over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 630e17650e80ca365418fd6b806acf7a23ede729.
Updated by Gerrit Code Review over 1 year ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/9471
Updated by Dmitry Dulepov over 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset f87ee3984ad8533d5481a9694c22b9ce1c14f66d.
Updated by Gerrit Code Review 11 months ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/12819
Updated by Gerrit Code Review 11 months ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/12820
Updated by Gerrit Code Review 11 months ago
Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/12819
Updated by Dmitry Dulepov 8 months ago
- Status changed from Under Review to Resolved
Applied in changeset 11b896da08998be69b7397c7d5f0aef45dab57d0.