Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Keep Alive Rate Topic   - - - - -

 
  • tweaker
  • Senior Member
  • Members
  • Join Date: 03-Aug 07
  • 156 posts

Posted 06 November 2013 - 05:53 PM #1

This is my full .htaccess file, modified utilizing the recommendations of gtmetrix.com.


DirectoryIndex index.html index.php

## ENABLE ETAGS

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
Header set Expires "Wed, 31 Dec 2014 20:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>


## ENABLE KEEP ALIVE

<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>


## ENABLE GZIP COMPRESSION

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
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>

# compress text, HTML, JavaScript, CSS, and 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

# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

# 480 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>

# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>

# 2 HOURS
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>


<IfModule mod_headers.c>
<IfModule mod_rewrite.c>
AddEncoding gzip .gz
RewriteCond %{REQUEST_FILENAME} \.(js|css)$
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]
</IfModule>

<FilesMatch .*\.css.gz$>
ForceType text/css
Header set Content-Encoding: gzip
Header set Cache-control: private
</FilesMatch>

<FilesMatch .*\.js.gz$>
ForceType text/javascript
Header set Content-Encoding: gzip
Header set Cache-control: private
</FilesMatch>

<FilesMatch "\.(ttf|ttc|otf|eot|woff|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine on
# Please note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.
# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
# RewriteBase /
Options -MultiViews

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteRule api/(.*)$ api.php?_d=$1&ajax_custom=1 [L,QSA]

RewriteCond %{REQUEST_URI} \.(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff)$ [or]
RewriteCond %{REQUEST_URI} store_closed.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)\/(.*)$ $2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,QSA]

</IfModule>


I'm being notified that I need to use persistent connections (keep alive) with a score of 85/100 with the following errors noted:Is there something I have configured wrong on my .htaccess file? This is a stock 4.0.3 with demo, fresh installation.

Thomas