Jump to content

Performance Tips


Recommended Posts

Yes good work Rocky.

I got a 70% compression on my product page loading which has really sped things up.

Dunno tho about that expiry date on the ETags, it would be good to find out more to see if this needs adjusting or just leaving as is.

Link to comment
Share on other sites

Great list of performance tips! I've applied as much as I could and have seen decent results!

I have some problems with you section on removing ETags... you said to place those 3 lines in the .htaccess, so I copied and pasted it at the end of my .htaccess, but kept getting 500 Internal Server Error. I've had to omit this step, but would like to get it resolved. My site could use all the help it can get.

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Something must be wrong. Once you've enabled that option and refreshed your page, it should be cached straight away in smarty/cache for faster loading. I'm not sure why it wouldn't do it. Did you also change 'compile_check' and 'force_compile' to false?

Link to comment
Share on other sites

I did it exactly as is in your tips.
var $compile_check = false;
var $force_compile = false;
var $caching = 1;
var $cache_dir = 'cache';
var $cache_modified_check = true;
I've also set chmod 777 for cache directory.
Or is it because of the Litespeed server?

Link to comment
Share on other sites

I had a similar problem with a website I did recently. It seems changing config/smarty.config.inc.php only is not enough for caching to work. I have to change tools/smarty/Smarty.class.php for the caching to work. My website has it enabled and seems to be working fine as far as I can tell.

Link to comment
Share on other sites

Actually I've changed both of them, the config/smarty.config.inc.php and tools/smarty/Smarty.class.php. The caching process works fine. But the result is my website had a malfunction. There will be impossible to add products into cart, to update the cart, to logout, etc. I really confused with this caching.

Link to comment
Share on other sites

  • 2 weeks later...

Hi rocky, after I tested the caching of prestashop on several different servers, which is apache, nginx, litespeed and XAMPP (localhost), I found that there is nearly impossible to turn the cache on for prestashop.

And just now I read this thread http://www.prestashop.com/forums/viewthread/43629/general_discussion/solving_cache_problems_dot_

I think he's right that prestashop doesn’t pass the ID to the smarty cache because that's what exactly happened to my site.

He gave some clue to overcome those ID issue, but I don't think that it's ready for production. I hope you have some idea about this issue because optimizing the smarty was very important to save my sites from being suspended by the hosting provider due to server load issue.

Thanks.

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

Hi Rocky,

I have this problem too

www.marketmataro.com/shop

If I enable cache with this line in .htaccess:

Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"


Then my shop has many errors:

I can't close sessions
Many errors with the four beginners categories
And many others

The only way to resolve this, is to change the Expires time to 2010, but then my shop is slow

Any solution?
Link to comment
Share on other sites

PrestaShop v1.4 adds the following optimisation code. Perhaps it will help:


   ExpiresActive On
   ExpiresByType image/gif "access plus 1 month"
   ExpiresByType image/jpeg "access plus 1 month"
   ExpiresByType image/png "access plus 1 month"
   ExpiresByType text/css "access plus 1 week"
   ExpiresByType text/javascript "access plus 1 week"
   ExpiresByType application/javascript "access plus 1 week"
   ExpiresByType application/x-javascript "access plus 1 week"
   ExpiresByType image/x-icon "access plus 1 year"


FileETag INode MTime Size

   AddOutputFilterByType DEFLATE text/html
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE text/javascript
   AddOutputFilterByType DEFLATE application/javascript
   AddOutputFilterByType DEFLATE application/x-javascript

Link to comment
Share on other sites

@Masternet

Yes, add that code to the bottom of your .htaccess file.

@finlander

What PHP version are you using? I had a client who had problems with their page not refreshing. They downgraded from PHP 5.3.2 to PHP 5.2.16, then it started working perfectly, so it might be an issue with PHP 5.3.

Link to comment
Share on other sites

@Masternet

Yes, add that code to the bottom of your .htaccess file.



Okay, so I put this code just below these lines?

Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
Header unset ETag
FileETag None



I have php version 5.2.13, must I upgrade to 5.2.16?

Thanks

Link to comment
Share on other sites

  • 1 month later...

I have now updated my Performance Tips for PrestaShop v1.4. Using these tips, I've managed to get a Google PageSpeed score of 92/100 on my website. I'm still trying to get the promised 98 by PrestaShop. I can't seem to get rid of the cookies being passed along with static content, even after setting up a separate static subdomain for the content. Also, my server doesn't support GZIP compression, so that's reducing my score a little.

Link to comment
Share on other sites

@angora

That code is already there in the Enable GZIP Compression and Browser Caching section.

@Paul

Thanks Paul. I thought the cookie was set only to the subdomains entered on the Tools > Subdomains tab. There's a foreach loop in the getDomain() function of classes/Cookie.php that I thought did this. I just tested the output and it returned nethercottconstructions.com, so it seems to have ignored the www subdomain on the Tools > Subdomains tab. Is this a bug I should report? I've only got one domain, so if I can't use a subdomain, then I can't serve static content without cookies.

Link to comment
Share on other sites

Rocky,

I've submitted selecting the cookie domain as a feature request for this reason. I had a quick look at the code you're talking about too because I though the same as you, but I can't work out what it's meant to achieve.... Apparently the current behavior isn't a bug (I tried and it got cancelled), but looking at that code I'm not so sure!

The other issue I had was that my static subdomains aren't covered by the ssl certificate, so when on an ssl page I got security warnings. I fixed that by ignoring the static domains when serving content on an https page.

Paul

Link to comment
Share on other sites

  • 1 month later...

using 1.3.1.1, I simply added a new dummy subdomain in the tools -> subdomains area and deleted the www subdomain. This makes prestashop cookie code believe www.domain.com is the domain and not domain.com , hence it puts the cookie on www.domain.com

remember to enforce requests coming in using the non-www version to redirect to the www version (in .htaccess for example)

I also had to change the google analytics code to force the domain in the request, because it was also setting it to domain.com, you can do this by adding for example _gaq.push(['_setDomainName', 'www.domain.com']); (for async version) before the trackPageView line.

Link to comment
Share on other sites

Hi Rocky

I hope all is well.

Have you changed these performance tips with 1.4?

We are going to do a large promotion in a few weeks that we figure (with the performance we are getting now) will crash our website. It will be a one-time thing though and if it's successful, we'll definitely repeat.

Based on our current calculations we figure we'll need 5-10 times the speed we are getting now.
Any suggestions?
Thank you
Phyllis

Link to comment
Share on other sites

Thanks Rocky,

We are going to do a large promotion in a few weeks that we figure (with the performance we are getting now) will crash our website. It will be a one-time thing though and if it’s successful, we’ll definitely repeat.

Based on our current calculations we figure we’ll need 5-10 times the speed we are getting now.
Any other suggestions?
Thank you
Phyllis

Link to comment
Share on other sites

Have you tried the advice on my website to set "Force compile" to "No" and "Cache" to "Yes" and enable the first four CCC options on the Preferences > Performance tab? You can also use Google PageSpeed in Firefox to download optimised images and use SpriteMe to automatically generate sprites. Another thing you can do is set up a subdomain called "static" using your cPanel, then enter static.yourwebsite.com as a media server. Also, if you are using modules from an earlier version of PrestaShop, you should modify the hookHeader function so that all the JS and CSS are included in the CCC instead of separately.

Link to comment
Share on other sites

  • 9 months later...
×
×
  • Create New...