Project

General

Profile

Actions

Bug #24200

closed

?1234567 on included CSS and JS breaks browser cache

Added by Christian Boltz over 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2010-11-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Since Typo3 4.4, the CSS and JavaScript files that are included by typo3 get "?1234567" (number varying) attached. Real exmples:

<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_fb20638762.css?1290624400" media="all">

<script src="typo3conf/ext/jquerycolorbox/res/js/jquery.js?1290624128" type="text/javascript"></script>

The problem with this: Firefox (and maybe also other browsers) interpret the ?1234567 as querystring and think it's a dynamic file.

The result is that the browser sends a request for all those files to the server on every page you load. Of course it will nearly always get a "403 not modified" response, but it still hurts performance without a real need.

I'd strongly recommend to remove the ?1234567 suffix again.

1. go to a page that is using Typo3 4.4 or newer
2. click any internal link (say: imprint)
3. click another internal link (say: contact)
4. login on the server and start watching the apache access log - or - use the network monitor of Firebug
5. click on the first used internal link (imprint) again

Expected result:
- all files are cached
- only the HTML is requested from the server

Actual result:
- the browser re-requests all CSS and JS files that have ?1234567 attached

(issue imported from #M16562)

Actions #1

Updated by Jigal van Hemert over 13 years ago

You can remove those suffixes yourself by a setting in the Install Tool:
-----------------------------------------------
[versionNumberInFilename]

Boolean: If true, included CSS and JS files will have the timestamp embedded in the filename, ie. filename.1269312081.js. This will make browsers and proxies reload the files if they change (thus avoiding caching issues). IMPORTANT: this feature requires extra .htaccess rules to work (please refer to misc/advanced.htaccess or the _.htaccess file from the dummy package)
If false the filemtime will be appended as a query-string.
[BE][versionNumberInFilename] = 0
-----------------------------------------------

It's not active by default because of the .htaccess rules which are needed.

If the option is not active the suffix is still useful for server side caching of merged and possibly compressed CSS/JS files.

Actions #2

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF