Bug #82565

Improve performance for version nr of file

Added by Faton Haliti almost 2 years ago. Updated 12 months ago.

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

100%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When processing javascript and css, typo3 currently incorrectly tries to process resources loaded from external as local resources, cause some very expensive file_exists calls.
In the function createVersionNumberedFilename($file) which will make the filename automatically change when a file is changed and re-cached by the browser will check for existence of the file and that might be expensive when we do not have the file and mode is not either 'embed' or 'querystring'
Setting
$GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = ''

Will still cause a check to the local filesystime, because

GeneralUtility::createVersionNumberedFilename
..
if (!file_exists($path) || $doNothing) {

One solution is to change this to

if ($doNothing || !file_exists($path)) {

Associated revisions

Revision aa7dcb65 (diff)
Added by Faton Haliti almost 2 years ago

[BUGFIX] Avoid unnecessary I/O in GeneralUtility::createVersionNumberedFilename()

With this commit we prevent to check for existence of file
when we don't need to, because mode is not either 'embed' or
'querystring'

Resolves: #82565
Releases: master, 8.7
Change-Id: I829b8e87d951a6f170bc03d8b7836f671b51bdf4
Reviewed-on: https://review.typo3.org/54221
Tested-by: TYPO3com <>
Reviewed-by: Anders Kostending <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Wolfgang Klinger <>
Reviewed-by: Frans Saris <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>

Revision 7b83bece (diff)
Added by Faton Haliti almost 2 years ago

[BUGFIX] Avoid unnecessary I/O in GeneralUtility::createVersionNumberedFilename()

With this commit we prevent to check for existence of file
when we don't need to, because mode is not either 'embed' or
'querystring'

Resolves: #82565
Releases: master, 8.7
Change-Id: I829b8e87d951a6f170bc03d8b7836f671b51bdf4
Reviewed-on: https://review.typo3.org/54238
Tested-by: TYPO3com <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>

History

#1 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54221

#2 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54221

#3 Updated by Gerrit Code Review almost 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54238

#4 Updated by Faton Haliti almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF