Jump to content

Speeding up WHMCS


sahostking

Recommended Posts

Hi guys,

 

I'm looking for the best way to score well on GTMEtrix and have my site fast.

 

I have done the following after installing smartoptimizer in the .htaccess file, anyone got any other ideas around this or tip?

 

# Smartoptimizer 1.8

 

<IfModule mod_expires.c>

<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">

ExpiresActive On

ExpiresDefault "access plus 10 years"

</FilesMatch>

</IfModule>

<IfModule mod_rewrite.c>

RewriteEngine On

 

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*\.(css))$ smartoptimizer/?$1

 

<IfModule mod_expires.c>

RewriteCond %{REQUEST_FILENAME} -f

RewriteRule ^(.*\.(css|html?|xml|txt))$ smartoptimizer/?$1

</IfModule>

 

<IfModule !mod_expires.c>

RewriteCond %{REQUEST_FILENAME} -f

RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico))$ smartoptimizer/?$1

</IfModule>

</IfModule>

<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">

FileETag none

</FilesMatch>

 

# End Smartoptimizer 1.8

 

# Add future Expires

 

<ifmodule mod_expires.c="">

ExpiresActive On

ExpiresDefault "access plus 1 seconds"

ExpiresByType text/html "access plus 1 seconds"

ExpiresByType image/gif "access plus 2592000 seconds"

ExpiresByType image/jpeg "access plus 2592000 seconds"

ExpiresByType image/png "access plus 2592000 seconds"

ExpiresByType text/css "access plus 604800 seconds"

ExpiresByType text/javascript "access plus 216000 seconds"

ExpiresByType application/x-javascript "access plus 216000 seconds"

</ifmodule>

 

# End future Expires

 

# Cache Control Headers

 

<ifmodule mod_headers.c="">

<filesmatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"="">

Header set Cache-Control "max-age=2592000, public"

</filesmatch>

<filesmatch ".(css)$"="">

Header set Cache-Control "max-age=604800, public"

</filesmatch>

<filesmatch ".(js)$"="">

Header set Cache-Control "max-age=216000, private"

</filesmatch>

<filesmatch ".(xml|txt)$"="">

Header set Cache-Control "max-age=216000, public, must-revalidate"

</filesmatch>

<filesmatch ".(html|htm|php)$"="">

Header set Cache-Control "max-age=1, private, must-revalidate"

</filesmatch>

</ifmodule>

 

# End Cache Control Headers

 

# Turn off ETags

 

<ifmodule mod_headers.c="">

Header unset ETag

</ifmodule>

FileETag None

 

# Remove Last-Modified header

 

<ifmodule mod_headers.c="">

Header unset Last-Modified

</ifmodule>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated