Jump to content

How To Fully Implement CDN on Prestashop 1.6


Recommended Posts

Hi guys,

 

I got everything ready to set up CDN on Prestashop 1.6.0.9 including SSL for the particular address.

 

But when I input CNAME address on media server & test run the website, some icons are not showing like

- Phone button on the top left

- Shopping cart button

- Plus button beside left panel of categories

- Social network button

All of them are icons which I can't check their source because when I inspect the element, it's just showing like i.icon-envelope-alt

 

And there is an error if I use inspect element on Chrome:

Redirect at origin 'https://cdn.address' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.address' is therefore not allowed accessRedirect at origin 'https://cdn.address' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.address' is therefore not allowed access

 

Another thing is, some pictures from the modules, was not automatically changed.

For example sliders from: https://www.prestashop.com/forums/topic/310597-free-module-sliders-everywhere-responsive-gallery-image-sliders-or-banners-now-3d/

Pictures from this module: https://www.prestashop.com/forums/topic/49728-module-cool-share-v26-bookmarks-with-style-ps-1216-compatible/

Pictures I have in this module: https://www.prestashop.com/forums/topic/246765-free-html-block-module/

Well, I can change the source code manually, but I thought media server also can change the pictures from the modules as well.

 

Is there any thing that needs to be done for this? Any help would be appreciated. Thank you very much.

Link to comment
Share on other sites

It would take looking at your site, but I can tell you some of the modules don't load their resources from the CDN. Also I am guessing that your fontawesome link is also breaking by the icons not showing. Are you pulling any 404 errors? Also, what CDN are you using?

Link to comment
Share on other sites

It would take looking at your site, but I can tell you some of the modules don't load their resources from the CDN. Also I am guessing that your fontawesome link is also breaking by the icons not showing. Are you pulling any 404 errors? Also, what CDN are you using?

 

This is the site, but at the moment I remove the CDN from media server. I only use it for pictures at the moment since some icons are not showing.

 

So at the moment, I edit the picture sources from the module on my homepage manually.

 

Not sure about 404 errors. The error message is posted up there. I am using CDN77.

 

This is the tutorial from their website for prestashop: https://client.cdn77.com/support/knowledgebase/cms-integration/prestashop-cdn-integration

 

How to fix it? Let me know if you want me to insert CNAME into media server right now. I can do it so that you can see what's going on right there.

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

Yeah, I would need to see the CDN in action to make a good guess at what is wrong. It looks like a pass through CDN so it should work without any issues.

 

Okay. I turn off apache optimisation & filled up the media server. It's on now.

 

I will keep it ON for an hour I guess, since I afraid some visitors become worried if I keep this error on the site for too long

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

It looks like the icons are working for me, http://screencast.com/t/HrcLSd73Fbhl

 

How come? I tried with Chrome & Firefox without the cache, it's not showing.

 

I will try to do this for fixing that error message: http://webmasters.stackexchange.com/questions/71630/font-blocked-from-loading-by-cross-origin-resource-sharing-policy-no-access-co

 

But for icons I have no idea what to do

Link to comment
Share on other sites

The icons are working for me and CDN seems to be working as well. It might be a server cache issue on your ISP. You might try going to a screenshotting service or gtmetrix and see if your page displays correctly, but it does for me. 

Link to comment
Share on other sites

The icons are working for me and CDN seems to be working as well. It might be a server cache issue on your ISP. You might try going to a screenshotting service or gtmetrix and see if your page displays correctly, but it does for me. 

 

In internet explorer, it seems ok. Tried in mozilla & chrome, it's not showing.

 

How about inspect element > console. Do you see any error?

 

I got this in Mozilla:

downloadable font: download failed (font-family: "FontAwesome" style:normal weight:normal stretch:normal src index:1): bad URI or cross-site access not allowed source: https://cdn.marbleceramiccorp.com.au/themes/default-bootstrap/font/fontawesome-webfont.woff?v=3.2.1

Link to comment
Share on other sites

Ahh, I just checked on my laptop, I am not seeing them. I have FA installed on my desktop. Try allowing the cross domain requests, that should fix it. 

 

I add that code already in my htaccess file:

<IfModule mod_headers.c>    
      Header add Access-Control-Allow-Origin "*" 
</IfModule>

I don't understand what does it mean when he said

"change your htaccess file code on resource server domain (i.e. The cdn htaccess; not the source calling the resource)"

 

Is this one also related to the font awesome? It's still not showing in my Chrome or Firefox. Tried in 2 computers...

  • Like 1
Link to comment
Share on other sites

I do see the error, the link you posted should fix it, it is because you are using https and loading from a sub domain. This is what I see in FF, http://screencast.com/t/sVdbun8tQ It looks like everything is working for me. 

 

Ohh! The icons are showing now! I purged the CDN resources on CDN client panel.

 

The only thing left is that error in cross domain request

Link to comment
Share on other sites

  • 11 months 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...