Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • fcosta774 Friend
    #203641

    Hi Guys

    It´s me with another question. I was testing my website with PageSpeed Insights made by google developers. they say that to increase the download speed of my website on cellphones and desktop computers I have to set up an expiration date in the HTTP headers for static resources, so the browser can load previously downloaded resources from local disk rather than through the network.
    How can I do that ?

    Thanks


    1. PageSpeed
    Ninja Lead Moderator
    #559041

    There are many ways to speed up your website:

    + Remove unnecessary White Space in HTML
    + Minify Javascript and CSS
    + Reduce requests by combining HTML, CSS, and Javascript
    + Optimize all your images – Most if not all should be at least below 10kb
    – Crop the white space using Photoshop
    – Use PNG8 Files or GIF files rather than Jpegs and don’t use transparency
    – Make images the size you want rather than resizing them in the editor
    + Uninstall any components/modules/plugins that you don’t actually use
    + Use Gzip Compression to Reduce HTML Size
    + Enable Caching as much as possible (page caching, view caching, module caching)

    fcosta774 Friend
    #559169

    Hi

    Thanks for all the suggestions. I already applied most of them. But PageSpeed Insights still say that I have to set up an expiration date in the HTTP headers for static resources, so the browser can load previously downloaded resources from local disk rather than through the network.

    Please, help me with this complication.

    Thanks

    Ninja Lead Moderator
    #559297

    It ‘s belong to caching on your site. You can use both way as below

    + Generally that is done using the .htaccess file on your host. Here is an example cut and pasted from HTTP cache headers with .htaccess

    <IfModule mod_headers.c>
    # WEEK
    <FilesMatch ".(jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=604800, public"
    </FilesMatch>

    If delivering materials from a PHP shell you could use PHP to create the header in which case you would refer to the HTTP protocal outlined here section 14.9 Cache-Control http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html and add it into templates/ja_university_t3/tpls/blocks/head.php file

    <?php
    /* This file is a wrapper, */

    header( 'Cache-Control: max-age=604800' );
    /* now get and send images */
    ?>

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  Ninja Lead 9 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum