[MGNLCACHE-192] Javascript resources not gzip compressed due to misconfiguration Created: 31/May/16 Updated: 17/Jan/18 Resolved: 19/Dec/17 |
|
| Status: | Closed |
| Project: | Cache Modules |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.5.7, 5.6.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Christopher Zimmermann | Assignee: | Maxime Michel |
| Resolution: | Fixed | Votes: | 6 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||
| Release notes required: |
Yes
|
||||||||||||
| Date of First Response: | |||||||||||||
| Sprint: | Basel 126, Basel 127 | ||||||||||||
| Story Points: | 0.5 | ||||||||||||
| Description |
|
By default magnolia is configured to (gzip) compress html, js, and css resources. This is configured at: /modules/cache/config/compression/voters/contentType/allowed CSS and HTML are correctly compressed, but JS files are not because their actual mimetype is "application/javascript" - while the compression config specifies "application/x-javascript". Possible solution: change js entry to "application/javascript" entry, or add an additional one. Ensure that the same mimetype is used for JS everywhere. To reproduce: Click on a js file (like respimage.min...js) And notice that Response Headers has no Content-Encoding (Note that this file is 8634 bytes when not compressed, and around 4000 when compressed. Big thanks to marvink2 for reporting. |
| Comments |
| Comment by Christopher Zimmermann [ 31/May/16 ] |
|
According to this stackoverflow post, the correct mimetype is application/javascript http://stackoverflow.com/questions/9664282/difference-between-application-x-javascript-and-text-javascript-content-types |
| Comment by Jonathan Ayala [ 25/May/17 ] |
|
Hello, Changing mimetype causes problems when accessing admin central and loading file /VAADIN/widgetsets/info.magnolia.widgetset.MagnoliaProWidgetSet/XXXXXXXXXX.cache.js More information provided in the linked ticket. Regards. |