In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1167 [In-Portal CMS] Optimization task always 2011-11-13 17:07 2012-07-25 05:30
Dmitry  
alex  
normal  
closed 5.1.0  
fixed  
 
none 5.2.0-B1  
https://groups.google.com/d/topic/in-portal-dev/aELuW-LC9ZQ/discussion
improved compressed css/js file naming
2
0001167: Improvements in Compressed CSS/JS File Naming
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.

While feature works well in general there is a problem though: 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.
NOTES:

1. please add ability to pass param "save_as='somename'" so it can be more readble name if needed.

2. ts=544433445 should be replaced with real date/time so it's easy to see if file is new or outdated.

Example: http://www.website.tld/system/cache/c_generalstyles.css?ts=2011-12-02_12:21:12

where 20111202 is date stamp and is 122112 time stamp (15hours-21min-12sec).
related to 0000040closed  (Icebox)Dmitry Issues with JavaScript and CSS Caching 
related to 0001177closed  (5.2.0)alex Debug version of CSS/JS files (decompressed) loaded even after Debug is Disabled via Cookies 
child of 0000457closed  (5.1.0)!COMMUNITY Automatic CSS / JS Compression 
patch disk_friendly_js_css_compression.patch (6,302) 2011-12-02 04:52
http://tracker.in-portal.org/file_download.php?file_id=1337&type=bug
patch friendly_url_for_compressed_js_css_addon.patch (574) 2011-12-07 06:22
http://tracker.in-portal.org/file_download.php?file_id=1349&type=bug
patch empty_compression_file_list_fix.patch (711) 2011-12-30 11:03
http://tracker.in-portal.org/file_download.php?file_id=1452&type=bug
patch disk_friendly_compression_513.patch (8,737) 2012-05-29 16:18
http://tracker.in-portal.org/file_download.php?file_id=1686&type=bug
Issue History
2012-07-25 05:30 alex Note Added: 0004880
2012-07-25 05:30 alex Status resolved => closed
2012-05-29 16:18 alex File Added: disk_friendly_compression_513.patch
2011-12-30 11:04 alex Changeset attached 5.2.x r14966
2011-12-30 11:03 alex File Added: empty_compression_file_list_fix.patch
2011-12-08 03:46 alex Relationship added related to 0001177
2011-12-07 06:23 alex Note Added: 0004212
2011-12-07 06:23 alex Status reviewed and tested => resolved
2011-12-07 06:23 alex Assigned To !COMMUNITY => alex
2011-12-07 06:23 alex Changeset attached 5.2.x r14836
2011-12-07 06:23 alex Note Added: 0004211
2011-12-07 06:23 alex Status needs testing => reviewed and tested
2011-12-07 06:22 alex Assigned To alex => !COMMUNITY
2011-12-07 06:22 alex Status needs work => needs testing
2011-12-07 06:22 alex File Added: friendly_url_for_compressed_js_css_addon.patch
2011-12-06 15:31 alex Additional Information Updated bug_revision_view_page.php?rev_id=923#r923
2011-12-06 14:02 Dmitry Note Added: 0004210
2011-12-06 14:02 Dmitry Status resolved => needs work
2011-12-02 04:55 alex Note Added: 0004192
2011-12-02 04:55 alex Status reviewed and tested => resolved
2011-12-02 04:55 alex Fixed in Version => 5.2.0-B1
2011-12-02 04:55 alex Resolution open => fixed
2011-12-02 04:55 alex Assigned To !COMMUNITY => alex
2011-12-02 04:55 alex Changeset attached 5.2.x r14818
2011-12-02 04:53 alex Note Added: 0004191
2011-12-02 04:53 alex Status needs testing => reviewed and tested
2011-12-02 04:53 alex Assigned To => !COMMUNITY
2011-12-02 04:53 alex Developer => alex
2011-12-02 04:53 alex Status active => needs testing
2011-12-02 04:52 alex Additional Information Updated bug_revision_view_page.php?rev_id=917#r917
2011-12-02 04:52 alex File Added: disk_friendly_js_css_compression.patch
2011-12-01 20:52 Dmitry Note Added: 0004189
2011-12-01 20:52 Dmitry Additional Information Updated bug_revision_view_page.php?rev_id=916#r916
2011-11-14 05:07 alex Reference [/url] => [url]https://groups.google.com/d/topic/in-portal-dev/aELuW-LC9ZQ/discussion
2011-11-13 17:09 Dmitry Relationship added related to 0000040
2011-11-13 17:08 Dmitry Relationship added child of 0000457
2011-11-13 17:07 Dmitry New Issue
2011-11-13 17:07 Dmitry Reference => [url][/url]
2011-11-13 17:07 Dmitry Change Log Message => improved compressed css/js file naming
2011-11-13 17:07 Dmitry Estimate Points => 2

Notes
(0004189)
Dmitry   
2011-12-01 20:52   
Please see additional notes added.
(0004191)
alex   
2011-12-02 04:53   
Will test all together later.
(0004192)
alex   
2011-12-02 04:55   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001167: Improvements in Compressed CSS/JS File Naming
(0004210)
Dmitry   
2011-12-06 14:02   
Please implement Human readable time format for "TS" as discussed in the groups.

Example: http://www.website.tld/system/cache/c_generalstyles.css?ts=20111202-182112
(0004211)
alex   
2011-12-07 06:23   
Will test all together later.
(0004212)
alex   
2011-12-07 06:23   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001167: Improvements in Compressed CSS/JS File Naming
1. compressed file url format changed
(0004880)
alex   
2012-07-25 05:30   
Since 5.2.0/1.2.0 versions was released.