davidmck77
New Member
- Messages
- 4
- Reaction score
- 0
- Points
- 0
Hi,
I wanted to add cache control and gzip compression to my site (blatmondo.x10.mx).
I've added this code to the .htaccess file, but it doesn't seem to work:
## Enable the mod_expires module
ExpiresActive On
## Set expiration date to 1 month for all style sheets and images
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
## Set expiration date to 1 week for all HTML pages
ExpiresByType text/html "access plus 1 week"
ExpiresByType application/xhtml+xml "access plus 1 week"
### Apply a Cache-Control header to index.html
<Files index.html>
Header append Cache-Control "public, must-revalidate"
</Files>
## compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
## Or, compress certain file types by extension:
<Files *.html>
SetOutputFilter DEFLATE
</Files>
Am I doing this correctly?
Are these modules enabled for free hosting sites like mine?
There are about five threads on the forum asking the same question, but none of them have an answer.
Time t add it to the FAQs?
Kind regards,
David McKinnon
I wanted to add cache control and gzip compression to my site (blatmondo.x10.mx).
I've added this code to the .htaccess file, but it doesn't seem to work:
## Enable the mod_expires module
ExpiresActive On
## Set expiration date to 1 month for all style sheets and images
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
## Set expiration date to 1 week for all HTML pages
ExpiresByType text/html "access plus 1 week"
ExpiresByType application/xhtml+xml "access plus 1 week"
### Apply a Cache-Control header to index.html
<Files index.html>
Header append Cache-Control "public, must-revalidate"
</Files>
## compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
## Or, compress certain file types by extension:
<Files *.html>
SetOutputFilter DEFLATE
</Files>
Am I doing this correctly?
Are these modules enabled for free hosting sites like mine?
There are about five threads on the forum asking the same question, but none of them have an answer.
Time t add it to the FAQs?
Kind regards,
David McKinnon
Last edited: