Jump to content

Trying To Understand Prestashop With Cdn


ianditch

Recommended Posts

PrestaShop version 1.6.1.4

Current theme in use default-bootstrap

 

 

I've downloaded Prestashop to try and all looks good but i cant get the cdn working...

 

For testing purposes, I have a subdomain which i have routed via 1and1's cdn (which uses cloudflare). I have uploaded all images, products & the default theme into this subdomain and pointed the prestashop media servers to this subdomain.

 

As i have ftp'd / uploaded my theme and the default product images into this sub domain, they show as expected at CDN.mysite.co.uk

 

My problem is that prestashop seems to create a cached copy of css and js files and saves them into the 'themes/default-bootstrap/cache/' folder and not into the subdomain. On page load, the browser is pointing to 'CDN.website/themes/default-bootstrap/cache/' but these files do not exist in the subdomain and thus, no style sheets or javascript are loaded.

 

How do i get prestashop to save these files into the subdomain???

 

 

Link to comment
Share on other sites

Right, i've been playing around with this and have created a function on the media.php file to copy the .css & .js files into the subdomain folder if these files do not already exist.

 

Doing this seems to be working well and has massively improved page load speeds, pagespeed score (90%) and Yslow score (97%) on GTmatrix. 

 

Other than the slightly slower server response if these files need to be copied and the future update issues, does anybody see any problems with taking this approach?

Link to comment
Share on other sites

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...