Improve your page speed score

Although Pavilion comes with good optimizations, there are some things that cannot be automated and you should tune them up manually. In order to get higher page speed results, please check out the following points:

1Make sure the cache is turned on.

2 Turn mod_deflate Compression On. Mod Deflate is an apache web server module that automatically compresses the output before being sent to the browser. This reduces the size of the content decreasing the time needed to transmit it the browser. There are plenty of tutorials on google how to enable mod_deflate. Here is the configuration we use for Pavilion demo (it should be put in the .htaccess file):

# Compressing output
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</Ifmodule>
Some hosting providers configurations do not allow to enable these settings through .htaccess. In this case you should ask your server adminsitrator to do it.

3 Set headers expiration. This directive will tell the browser to cache the static resources. This will improve the subsequent page hits as the resources (scripts, styles) will be served from the browser cache and not loaded through the network. The Pavilion demo uses the following setup:

# BEGIN Expire headers
<ifModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 5 seconds"
  ExpiresByType image/x-icon "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
  ExpiresByType text/html "access plus 600 seconds"
  ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
  <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(css)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(js)$">
    Header set Cache-Control "private"
  </filesMatch>
  <filesMatch "\.(x?html?|php)$">
    Header set Cache-Control "private, must-revalidate"
  </filesMatch>
</ifModule>
# END Cache-Control Headers

# Defining MIME types to ensure the web server actually knows about them.
<IfModule mod_mime.c>
    AddType application/javascript          js
    AddType application/vnd.ms-fontobject   eot
    AddType application/x-font-ttf          ttf ttc
    AddType font/opentype                   otf
    AddType application/x-font-woff         woff
    AddType image/svg+xml                   svg svgz
    AddEncoding gzip                        svgz
</Ifmodule>

Again, some hosting providers won’t allow you to enable these directives with .htaccess. You should write to the support staff to enable them.