Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compression for transferring combine #1847

Closed
vebam opened this issue Mar 16, 2016 · 4 comments
Closed

Compression for transferring combine #1847

vebam opened this issue Mar 16, 2016 · 4 comments

Comments

@vebam
Copy link

vebam commented Mar 16, 2016

Hello,
Why /combine/* stylesheet is gziped,
/combine/* script don't.

clipboard01

@gabsource
Copy link
Contributor

Apache /etc/apache2/mods-available/deflate.conf may look like this (should be the defaults on Ubuntu 14.04) :

    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript

So it does not recognize text/javascript Content-Type header as a candidate to compression.

Adding AddOutputFilterByType DEFLATE text/javascript in .htaccess should trigger compression for combined javascript.

\System\Classes\CombineAssets@getContents sets $mime = 'text/javascript'; at line 178.

@vebam
Copy link
Author

vebam commented Mar 21, 2016

Thanks, is working.

I will add:
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css

@daftspunk
Copy link
Member

@gabsource Should this be changed to application/javascript?

@gabsource
Copy link
Contributor

text/javascript is deprecated per RFC 4329 in favor of application/javascript
https://www.rfc-editor.org/rfc/rfc4329.txt

 Use of the "text" top-level type for this kind of content is known to
   be problematic.  This document thus defines text/javascript and text/
   ecmascript but marks them as "obsolete".  Use of experimental and
   unregistered media types, as listed in part above, is discouraged.
 The media types,

      * application/javascript
      * application/ecmascript

   which are also defined in this document, are intended for common use
   and should be used instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants