Extensions

Client side optimization

    Developer:

    As per yahoo! optimization guidelines http://developer.yahoo.com/yslow/ for making Zenphoto faster at client-side, here are some hacks.

    FIRST: Edit .htaccsss file and add the following lines.

    <ifmodule mod_expires.c><filesmatch "\.(jpg|gif|png|css|js)$">
    ExpiresActive on
    ExpiresDefault "access plus 1 year"
    </filesmatch>
    </ifmodule>FileETag None
    That will make your image, javascript,css files cache lifetime 1 year+ and Removes Etags, If Apache WebServer?has attached any. So that webpage header size can be reduced.

    SECOND: If your web server is supporting gzip compression, edit index.php and add following line at Top of the page.

    header("Vary: Accept-Encoding");if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
    ob_start("ob_gzhandler");
    else ob_start();

    So, Web server will deliver entire webpage as gzip compression format to the browser. So, network bandwidth can be reduced.

    THIRD: Convert your all JavaScript, CSS files into PHP code (Make simple echo statement) and follow SECOND step for them. Finally, load them in templates. That will make your JavaScript, css gzip-compressed & faster deliverable.

    SampleJavaScript.js.php
    if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'],
    'gzip'))
    ob_start("ob_gzhandler");
    else ob_start();
    header("content-type: application/x-javascript; charset: UTF-8");
    $gd = "Expires: Monday, January 18, 2038 12:44:06 AM";
    header($gd);
    zen.css.php
    <?phpif (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
    ob_start("ob_gzhandler");
    else ob_start();
    header("Content-type: text/css; charset: UTF-8");
    $gd = "Expires: Sun, 1 Jan 2017 05:00:00 GMT";
    header($gd);
    ?>


    image.php

    <link rel="stylesheet" href="/themes/sterile/zen.css.php"></link>

    try to put javascript before </body>
    image.php

    <script src="/themes/sterile/SampleJavaScript.js.php"></script>

    So, The loading of web-page won't blocked untill javascript is loaded.

    You can check the performance of the site http://actress.bollysite.com and test It with Firefox firebug-Yslow plug-in.

    Please note: This extension or tool has been abandoned either by the Zenphoto team or its original 3rd party developer but we provide it for archival purposes on our "unsuppported" GitHub repository "as is". We generally do not update these extensions (See the circle icon about the status).

    It is not possible to download individual extensions from the GitHub repository. You have to download the full repository (click on "Download ZIP") and sort out what you need yourself.

    Download from the "unsupported" GitHub repository

    For questions and comments please use the forum or discuss on the social networks.


    More by author:

    • Nothing else available by Vikaskbh

    Related items