Jump to content

Prestashop 1.4: using CCC performance and Media Servers


justinwpw

Recommended Posts

I'm using Prestashop 1.4.0.17.

I have selected the CCC performance parameters, but I can’t find the cached content. In what directory is it stored?

I assume I need to copy this cached content to my other servers to use cookieless static content. Is that correct?

Does anyone have any advice on how to set up Amazon Cloudfront edge servers as the media servers?

Link to comment
Share on other sites

The combined JS and CSS files are in themes/yourtheme/cache. I'm not sure whether you need to manually copy them. You can set up a redirect between domains. On my site, I created a static subdomain and set it up to automatically redirect to the www subdomain. It seems to be working.

Link to comment
Share on other sites

  • 2 months later...

I'm not 100% sure on how this feature works, but I think I've got it working on my website. It seems to make the website faster, but I have no proof that it actually does. I went to my cPanel, chose the "Subdomains" option, then added a new subdomain "static" that redirects to "www". After doing this, I went to the Preferences > Performance tab and entered static.nethercottconstructions.com as a media server. Now, when I go to my website, all my CSS, JavaScript and images are read from static.nethercottconstructions.com and the other files are read from www.nethercottconstructions.com. There is no need to manually copy files from www to static, the redirection should handle that automatically. Theoretically, doing this should prevent cookies being passed whenever CSS, JavaScript and images are requested, since cookies only apply to the www subdomain. This should save bandwidth and speed up your website.

Link to comment
Share on other sites

If your paying less than 150 a month you are more than likely on a vps or shared account. usually with dedicated boxes you get to pick what processor, hd, memory etc.

great idea on getting the media servers to work. It should allow the browser to get more connections to the server.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry i dont use Cpanel, i use grid shared server from mediatemple, i redirect with .htaccess. Is true this method?. And after redirection do i have do enable CCC for CSS. and Use CCC for JavaScript? I tryed with enable them but after active CCC for CSS. and Use CCC for JavaScript there happened CSS erro on product page.

Link to comment
Share on other sites

1. How can I make this redirection to test it on localhost?
I've redirected static.mydomain.tld to http://localhost, but it didn't work, all images are replaced with question marks.

2. CSS and js aren't static content? These files shouldn't be also on static.mydomain.tld?

3. I activated all ccc option from performance (in 1.4.3), but I receive some errors, although in 1.4.2.5 worked ok.

Link to comment
Share on other sites

1. I'm not sure whether it's possible to redirect using localhost. You may have to upload your website to a server before you can do.

2. Yes, CSS and JavaScript are static content just like images. PrestaShop's media servers option includes all of these.

3. I haven't had time to upgrade to PrestaShop v1.4.3 yet, so I can't help there. It's working fine on my v1.4.2.5 website.

Link to comment
Share on other sites

Thanks for your quick reply.

Regarding 2: I've completed on media server static.mydomain.tld (just in the first field), but when I looked at my site source, it appears that only images are loaded from subdomain. CSS and js are loaded from localhost. What do I do wrong? I mean, even if it didn't work ok on localhost, at least I want to see that these files are loaded from subdomain. Next, I'll see what happens when I'll load the site on the server.

Link to comment
Share on other sites

  • 2 weeks later...

On the Yslow page at Yahoo, I read that for Media Servers to work ans serve static content, it must be a cookie-less domain, and that if the topdomain serves cookies, using a subdomen does not work. I have tried using an entirely different domain, but it does not work, images are not served at all.

I am wondering if there are any files that need to be copied to the image domain or not? I tried copying the whole IMG folder there, but it did not work.

Side-remark: I think it would be a smart move from the Prestashop Developers to create a quick guide to the Media Server feature that would help people use it, there are constantly new threads on the forum about this, and it might clarify this issue once and for all if we had an instructions guide.

  • Like 1
Link to comment
Share on other sites

  • 10 months later...

I went to my cPanel, chose the "Subdomains" option, then added a new subdomain "static" that redirects to "www". After doing this, I went to the Preferences > Performance tab and entered static.nethercottconstructions.com as a media server.

 

I followed the exact instructions, but my images aren't showing up when I add the static.mydomain.com as a Media Server. I have browsed the forums and forge and see that it might have to do with cookies on the main www domain. Did you do anything to surpass this? And any thoughts on how else to get this to work?

 

Also, I followed the tips from this page: http://www.prestashop.com/blog/en/10-best-tips-to-speed-up-your-prestashop-store-3/#comment-1899

 

 

5. Create sub-domains for Javascript files and CSS files

  1. Create a sub-domain js1.mystore.com and ask your hosting provider to direct it to /js/
  2. Create a sub-domain js2.mystore.com and ask your hosting provider to direct it to /theme/mytheme/js/
  3. Create a sub-domain css1.mystore.com and ask your hosting provider to direct it to /css/
  4. Create a sub-domain css2.mystore.com and ask your hosting provider to direct it to /theme/mytheme/css/

These 4 sub-domains will allow your visitors to load more files at the same time. Basically, a web-browser is limited to 8 parallel downloads. Each sub-domain is adding 8 new parallel downloads, so the total would be 40 (Main domain + 4 sub-domains).

 

As it seems to be doing something similar. Would I add those subdomains to the Media Server bit or do I point towards them somewhere else?

Link to comment
Share on other sites

  • 2 weeks later...

Hi, when i activated SSL and use subdomain in Media Server, the images are not showing on https pages, i think i have to use SSL also for sabdomain, is it true, can anybody help about this?

 

I'm having this problem on v1.4.6. Using Rocky's method above works fine on regular pages (speed noticeably increased), but no css or images loaded when on https.

 

Anyone know how to fix this? Perhaps by forcing the content to be called from it's original location when on https pages, rather than the media server/subdomain?

 

Cheers.

Link to comment
Share on other sites

5. Create sub-domains for Javascript files and CSS files

  • Create a sub-domain js1.mystore.com and ask your hosting provider to direct it to /js/
  • Create a sub-domain js2.mystore.com and ask your hosting provider to direct it to /theme/mytheme/js/
  • Create a sub-domain css1.mystore.com and ask your hosting provider to direct it to /css/
  • Create a sub-domain css2.mystore.com and ask your hosting provider to direct it to /theme/mytheme/css/

These 4 sub-domains will allow your visitors to load more files at the same time. Basically, a web-browser is limited to 8 parallel downloads. Each sub-domain is adding 8 new parallel downloads, so the total would be 40 (Main domain + 4 sub-domains).

 

 

but in Prestashop there are only 3 lines to write subdomains

 

 

more questions, see my post http://www.prestashop.com/forums/topic/170993-ccc-server-how-to-use-configure-it/#entry844457

Edited by adamus007p (see edit history)
Link to comment
Share on other sites

  • 1 month later...

I created 3 subdomains and pointed them ALL to my root folder, I can then see that different images are served from different locations, I use webpagetest.org which shows it is working, try it before and after. My first byte score went from an "F" to a "D" rating.

This seems to only serve images from different locations and my css/js files are no longer compressed but it's still an improvement.

Link to comment
Share on other sites

  • 1 year later...

I created 3 subdomains and pointed them ALL to my root folder, I can then see that different images are served from different locations, I use webpagetest.org which shows it is working, try it before and after. My first byte score went from an "F" to a "D" rating.

This seems to only serve images from different locations and my css/js files are no longer compressed but it's still an improvement.

 

Hi Ralph

 

I had also done the same way, but my website came out in a total mess. I have attached the picture.

post-481781-0-10517500-1377371474_thumb.png

Edited by cutecat (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hi Ralph

I had also done the same way, but my website came out in a total mess. I have attached the picture.
attachicon.gif Untitled.png

 

Hey Cutecat!

Did you manage to do it in the end? I got the same outcome as you but when i did a wildcard redirect from the subdomain to the shop domain the layout returned to normal. You can see through the network tab in the browser that the servers are being used, but there doesn't seem to be any change in page load though.

Edited by Cari (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

just wondering if using a cookie-free domain will have a bad effect on my website? do i have to set up a subdomain to use it? also is this the code?

 

 Header unset Cookie
  Header unset Set-Cookie
<FilesMatch "!\.(gif|jpe?g|png)$">  
    php_value session.cookie_domain example.com  
</FilesMatch>
Link to comment
Share on other sites

irrelevant, Prestashop uses no session at all.

If you are on the same domain, user-agent will send the cookie to your media server regardless of the content serviced.

Honestly unless you face 15millions hit per hour don't bother with the cookie-less domain thingy - it will only cost you another domain and deserve no purpose in daily scenario

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...