: Pre-gzipping files and serving to clients possible? I understand that we can do some settings in .htaccess to allow gzipping on the fly. However is there anyway we could do it "not-on-the-fly"?
I understand that we can do some settings in .htaccess to allow gzipping on the fly.
However is there anyway we could do it "not-on-the-fly"?
I have a static file that I wish to serve gzipped, but I do not wish to do the gzipping on the fly (in other words pre-gzipped).
How would we go about doing it?
More posts by @Berryessa370
1 Comments
Sorted by latest first Latest Oldest Best
Won't work with IE6 browsers, but here's how WordPress users do it.
perfectionlabstips.wordpress.com/2008/12/30/serving-gzipped-gz-files-as-compressed-css-javascript-html-content/
Their examples are for CSS and JavaScript, but it's easily applicable for .html from the samples.
They show you how to detect for browsers that won't work and keep an uncompressed copy and compressed copy side by side so your site will work with unsupportive browsers.
The following rule detects if the browser supports gzip, checks to see if you have a .gz file of the same name as the requested file and serves it instead of the uncompressed file:
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ .gz [L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.