-
Type: Bug Report
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.1.0
-
Fix Version/s: 5.2.0-B1
-
Component/s: Optimization
-
Labels:None
-
External issue URL:
-
Additional information:
-
Change Log Message:improved compressed css/js file naming
-
Story Points:2
-
External issue ID:1167
-
Copy Issue Key:
-
Patch Instructions:
Starting with In-Portal 5.1.0 new feature was introduced. This feature allows to merge all js/css files on the page into one file and then compress it. This allows to significantly enhance website loading time.
[B]While feature works well in general there is a problem though:[/B] old versions of compressed files are never deleted.
Currently filename is generated by following scheme:
<d¦c><filenames_crc><timestamp>.<css¦js>
This way new file is created every time developer forces a recompression procedure by pressing "refresh" button in themes list in admin console.
I'm proposing to move timestamp part away from filename part into that file's url parameters. We actually could just use file modification time from file system instead of keeping it in 2 places, like now.
For example url "http://www.website.tld/system/cache/c_1253243_544433445.css" becomes "http://www.website.tld/system/cache/c_1253243.css?ts=544433445".
This way we always use the same file and just change it's url, so web browser would read it from server and not from it's cache.