Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-948

Improvements in Compressed CSS/JS File Naming

    XMLWordPrintable

    Details

    • 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
    • Additional information:
      Hide

      [B]NOTES:[/B]

      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.

      [B]Example:[/B] 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).

      Show
      [B] NOTES: [/B] 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. [B] Example: [/B] 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).
    • Change Log Message:
      improved compressed css/js file naming
    • Story Points:
      2
    • External issue ID:
      1167
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                dmitry Dmitry Andrejev [Intechnic]
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: