I have the following javascript into a index.php file:
<script type="text/javascript">
$('.showpics, .showpics2').live('click', function() {
var theuser = $(this).attr('href');
$("#piccall:hidden").load('pictures.php?user='+theuser, function () {
$('#picsbig:hidden').show();
});
$('#picsbig:visible').hide();
return false;
});
</script>
The pictures.php file is formed by a doctype declaration, html tag, head (with two css files), body, some php which reads the GET var., DB functions, reading the user pics functions and displaying them. At the end of this file, two javascript files (which are not loaded in the file who is loading this one as well), body end tag and html end tag.
Pictures.php has about 130 lines of code per total.
The thing is, after the click which calls the load of this page, there comes a lag of about 3 seconds after which it is displayed without any errors.
Is there any way I could make this go faster?
Apache is running on a VPS with the following configuration: CentOS 5.5 x64, 1024MB memory, 500GB Band, 0.8GHz
Thank you!
enable the caching on the server, here is a guid how to do it with apache
http://httpd.apache.org/docs/2.1/caching.html
more over you can set
cache:truein theajaxglobal setup