Menu

#4833 (ok 4.4.2) CSS and Javascript are not compressed

4.4.1
fixed
None
Low
2015-04-13
2015-04-02
No

Discussion

  • Madhura Jayaratne

    I suppose you refer to the concatenated Javascript (with get_scripts.js.php) and phpmyadmin.css.php. With zlib.output_compression=on in php.ini I can see them being served compressed.

    See the attached images

     
  • Marc Delisle

    Marc Delisle - 2015-04-03

    Madhura,
    the idea was to avoid a dependency on a php.ini setting.

     
  • Madhura Jayaratne

    I see

     
  • Madhura Jayaratne

    • assigned_to: Madhura Jayaratne
     
  • Michael

    Michael - 2015-04-09

    If the CSS/JS is static just use style like this for every new release:

    pma-<? print md5(PMA_VERSION_NUMBER) ?>.css
    pma-<? print md5(PMA_VERSION_NUMBER) ?>.js

    Of course you have:

    a) to prepare the correct css/jss files in the folder OR
    b) better solution: add a rewrite like "pma-[0-9a-z]{32}.(?:js|css)" to the pma.[js|css] file

    If you want to parse it with php just make the rewrite to the the php file and set the correct Content-Type and expire date as needed, example:

    header('Content-Type: text/javascript; charset=utf-8');
    header('Expires: '.gmdate('D, d M Y H:i:s', time() + 604800).' GMT');

    Then the webserver will deal with the compression.

     
    • Madhura Jayaratne

      I guess you will have to have zlib.output_compression=on in php.ini for webserver to automatically deal with the compression.
      As Marc mentioned the idea was to avoid a dependency on a php.ini setting

       
  • Michael

    Michael - 2015-04-09

    I would not handle this in PHP as I said. If you set the right header, the webserver can decide on its own, if this ressource can/should be compressed:

    header('Content-Type: text/javascript; charset=utf-8');

    Then for example NGinX will compress it automatically, if compression is enabled and the appropriated types are set:

    gzip on;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    Apache or other webservers are similar.

     
  • Marc Delisle

    Marc Delisle - 2015-04-10
    • summary: CSS and Javascript are not compressed --> (ok 4.4.2) CSS and Javascript are not compressed
    • status: open --> resolved
    • Group: 4.4.0 --> 4.4.1
    • Priority: Normal --> Low
     
  • Marc Delisle

    Marc Delisle - 2015-04-13
    • Status: resolved --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.