I know nothing about using this apache directive and was wondering what do I need to add to the .htaccess file gzip miva pages?
Announcement
Collapse
No announcement yet.
mod_gzip and miva pages
Collapse
X
-
Re: mod_gzip and miva pages
This will compress html|js|css|jpg|jpeg|gif|png files. My understanding is that Miva Empresa engine does not support gzip on the mvc file format.
Check with your host before implementing the htaccess directive to see if it is allowed.
Code:AddOutputFilterByType DEFLATE text/css text/html application/x-javascript application/javascript <FilesMatch "\.(js|css|jpg|jpeg|gif|png)$"> Header set Cache-Control "max-age=5184000, public" </FilesMatch> <FilesMatch "\.(html|htm)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch>
-
Re: mod_gzip and miva pages
The first part adds compression to html, javascript and css files.
Be careful about using the second part as its not suitable for all sites; that is telling browsers that they can cache image, js and css files from that site for up to 60 days without checking that a newer version exists, so if you set that up and then change any of the files in question, your visitors could be seeing old data for quite a while if they have an old version cached. The second part tells browsers they can cache the html files for two hours.
Comment
-
Re: mod_gzip and miva pages
Thanks David for clearing that up.
Just one more question what would mod_gzip look like?
Would it be something like this:
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl|jpg|png|gif)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>Last edited by capnhud; 03-24-10, 08:44 AM.
Comment
-
Re: mod_gzip and miva pages
Originally posted by Siamese-Dream.Com View PostHi there, David:
so would you recommend doing that first part in order to speed up load times?
Comment
-
Re: mod_gzip and miva pages
Hi there, David:
Thanks for the response:
ONLY if you have large css or javascript files.
And would that size limit be the same for jpg or other image sizes? Or is there a different size limit for image files before compression becomes effective?
Thanks in advance,
MarkMark Romero
~~~~~~~~
Comment
-
Re: mod_gzip and miva pages
Originally posted by Siamese-Dream.Com View PostHi there, David:
Thanks for the response:
Can I ask you how large is large? About how big can a javascript / css file get before compression becomes a viable option???
And would that size limit be the same for jpg or other image sizes? Or is there a different size limit for image files before compression becomes effective?
Thanks in advance,
Mark
Text-based file types can be, but I would not waste the time doing it unless you're serving more than 50 KB per file on average; i.e. if you have five css files included and one is 60 kb but the other four are 4 kb, don't compress, or merge them all into one and compress it.
Comment
Comment