Closed oupala closed 6 years ago
It’s a long time I don’t configure Apache. The simplest solution would be to only upload the gzipped resources to the server. You don’t need a .gz
extension. Else you would need to map requests to the gzipped files with a rewrite rule: https://httpd.apache.org/docs/current/mod/mod_rewrite.html
I found a way better solution that rewriting urls: it is content negociation (see this post for more informations).
The problem is that solution require to have gzipped resources, and .gz
named resources.
Do you think it would be possible to add a new option to this plugin, in addition to the overwrite: true
option?
This option could for example be replace: true
.
.use(compress();
style.css
style.css
// original filestyle.css.gz
// gzipped file.use(compress({overwrite: true});
style.css
style.css
// gzipped file (without extension in its name).use(compress({replace: true});
style.css
style.css.gz
// gzipped file (with extension in its name)Let me know.
see #11
Can you provide an example of an httpd configuration to use gzipped resources?
I can enable mod_deflate on httpd to enable on-the-fly gzipping. But when we use metalsmith-gzip, gzipped resources are already existing and hence we don't need on-the-fly gzipping.
We need apache to use the already existing gzipped resources. How can we tell apache to do so?