Client side optimization November 13, 2009 / Updated: May 17, 2015
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.
This extension has been abandoned by the ZenphotoCMS team and we provide it for archival purposes on our "unsuppported-plugins-offical" GitHub repository "as is". .
For questions and comments please use the forum or discuss on the social networks.