I have prepared all the settings (at my home , Windows 10) for creating and serving js
as gz
files , but still - I get only the regular js
files (with the original size).
Configuration
— Angular's webpack file :
new CompressionPlugin({
asset: "[path].gz[query]",
algorithm: "gzip",
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
— Output files for that configuration:
— Index.html file:
...
<body>
<app-root>Loading...</app-root>
<script src="/dist/polyfills.bundle.js"></script>
<script src="/dist/main.bundle.js"></script>
</body>
...
Diagnostics
When I navigate to http://kkk.com/index.html
, I get the full size files :
Also - looking at the request headers , I do send the Accept-Encoding:gzip, deflate
header :
Question
Why doesn't the GZ files served ?
Additional info :
- There is no 304 responses , I set .
- At my work , windows 7 , same files - I DO(!) see the gziped files :
- Disabled Antivirus
- Permissions : Everyone : full control on the file's folder.
- Comparison between request headers :
- Since I don't want real time zipping , but PRE-ZIPPING ( files which already gzipped by angular) - I tried enabling AND disabling compression(just to see if it affects something - but it doesn't - I still get the big files) :