Jump to content

[Solved] browser caching (.htaccess) improves performancerate on .com-domain, but not on .nl-domain


Recommended Posts

Hi all,

I was optimizing my site by enableing GZIP Compression and Browser Caching. I modified my .htaccess file, and was checking the results with Google Pagespeed.

before the modification I had a score of 63. After mod, still 63 ??? (.nl-site)

then I noticed when I check Google pagespeed on my .com-domain, the score is 81! So it seems, the caching/compression works only on my .com-domain, and not on my .nl-domain.

Does this mean something is not configured right in Presta, or on my hosting? My site is .nl, but because I could register 2 domains for free, I took the .com as "extra". (I hope this is understandable due to my poor english :red: )


PS: I've 1 hosting with 2 domain-names registered (.nl and .com).

Link to comment
Share on other sites

initially, both -.nl and -.com are redirected internally to ../

also tried to redirect .com externally to .nl, but has no effect.

any ideas where to look?

Google Pagespeed indicates:
com: browser-caching enabled, compression disabled
.nl: browser-caching disabled, compression disabled.

my .htaccess content:

# URL rewriting module activation
RewriteEngine on
RewriteCond %{http_host} ^mekkadeco.nl [nc]

# URL rewriting rules
RewriteRule ^(.*)$ http://www.mekkadeco.nl/$1 [r=301,nc]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [QSA,L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [QSA,L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /404.php


   ExpiresActive On
   ExpiresByType image/gif "access plus 1 month"
   ExpiresByType image/jpeg "access plus 1 month"
   ExpiresByType image/png "access plus 1 month"
   ExpiresByType text/css "access plus 1 week"
   ExpiresByType text/javascript "access plus 1 week"
   ExpiresByType application/javascript "access plus 1 week"
   ExpiresByType application/x-javascript "access plus 1 week"
   ExpiresByType image/x-icon "access plus 1 year"

FileETag INode MTime Size

   AddOutputFilterByType DEFLATE text/html
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE text/javascript
   AddOutputFilterByType DEFLATE application/javascript
   AddOutputFilterByType DEFLATE application/x-javascript

Link to comment
Share on other sites

OK, seems the browser-caching problem is solved. I changes the redirection on my hosting again and now Google give the same score.

Only main issue remains: I cannot manage to get compression on >:-(
tried mod_deflate.c and mod_gzip.c, but both doesn't seem to work.........very frustrating. My provider keeps telling me they support compression.



---> UPDATE: just called my hosting: they told me they do NOT support compression :P :ahhh:
time to move to another hosting when my contract has finished...

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...