Vote for v1.5 Fixes

PrestaShop Forum: Build a free online shop. Count on the Community!

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum: Build a free online shop. Count on the Community!

Jump to content

 
Photo

Using CDN with prestashop

cdn prestashop cdn cloudfront amazon cloud front

  • Please log in to reply
35 replies to this topic
mozack

    PrestaShop Apprentice

  • Members
  • PipPip
  • 267 posts

Posted 14 September 2011 - 06:38 PM

Hi, to all

Recently i started using Amazon CloudFront as cdn. I put the address in media server and everything is working (almost fine).

Here is my questions regarding that:

1 - How to update the themes/mytheme/cache files when they are updated? I think the CDN reload the file every time he changes, but prestashop must change the file name or something like that.

2 - How to auto load the css, js and images from modules folder to be loaded by cdn too?

3 - How to make the images with expiration date?

I saw some of CDN servers and we should have more flexibility to edit and update important files like that. Some of the ecommerce script available in market use something like myfile.css?12345, this is usually updated via file last update which force cdn to reload that file.

Hope someone can help me with this 3 little questions...

Regards

Mozack

Mozack Blog - http://izak.txt.pt
@djmozack


MCCS

    PrestaShop Newbie

  • Members
  • Pip
  • 6 posts

Posted 26 September 2011 - 06:31 PM

yes, again i would really like this working with also simpel url's. a cdn is an real requirement..
thanks

mytheory.

    PrestaShop Apprentice

  • Members
  • PipPip
  • 416 posts

Posted 21 October 2011 - 06:33 AM

Hi,

We've been trying to implement the Media Server feature but have not gotten this to work, and it seems like we have tried everything. There is no solid documentation on how to use this feature.

We discovered Amazon CloudFront and would really like to use them as CDN and set it up as our media servers... it seems like you have been able to get this working, which is great! Would you mind sharing how you set everything up and how it works??

Thanks so much!

philee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 339 posts

Posted 27 October 2011 - 02:11 PM

Did you guys ever got your CDN working for your stores? Also, how did this improve your site loading speed?

I am starting to look into CDN to give customers a low latency for website browsing.

mytheory.

    PrestaShop Apprentice

  • Members
  • PipPip
  • 416 posts

Posted 30 October 2011 - 08:07 AM

Hi,

Haven't set this up yet... but I did sign up for Amazon's CloudFront. We've been upgrading our site most of today, so once we get the finishing touches done this is our next step. Hopefully, by tomorrow or the next day I will have a chance to at least try and set this up.

Will report back.

mytheory.

    PrestaShop Apprentice

  • Members
  • PipPip
  • 416 posts

Posted 30 October 2011 - 11:20 PM

Ok... so real quick. I think we managed to get this up and running... CDN using Amazon Cloudfront.

It was actually very easy... but we are going to test further. But as a prelim here is how we set it up.

You need to sign up for Amazon's AWS service... it's free and you only get charged for the services you use.

For this purpose, you need to have CloudFront available. Nowadays, if you sign up for one of their other services, this service should be available. IE. If you signed up for S3 or EC2 the CloudFront service should be available. Click on the "CloudFront" tab. If the service is available you will be able to create a "distribution" otherwise it will have different link asking you to sign up for this service, in which case, go ahead and sign up and then go back to the tab to create a distribution.

It will give you a series of fields that need to be filled out... some are optional and you can find more details by hovering over the title of each field. Basically, we set ours up to orginated from our server (that does not run off of EC2 or S3)... so we selected "custom origin" then entered our domain name. We allowed connections for both HTTP and HTTPS... added no CNAMEs (going to use the one automatically generated by Amazon). Entered nothing for Default Root Object (later we might test with index.php as this field, but nothing for now). Logging is set to off... if enabled you will need to link it to an S3 bucket (so you have to sign up for this storage service also). Then selected "Enabled" for the distribution status. Very easy... then finish by saving or creating the distribution.

Once this is created and enabled... you will see it in the list. You will see a column titled "Domain Name" we just copied this domain name (something similar to xxxxxx.cloudfront.net). Then we went to our BO... Preferences tab >> Performance >> scroll down to Media Servers. BTW... you need to enable the CCC options to take advantage of this feature. So enable CCC from above then for Media Server 1 paste the Amazon cloudfront domain name and click save.

Go to front office and reload the page... at the bottom left corner (or right corner) you will see the loading status of the page so if set up correctly, you should see the Amazon cloudfront domain name as it loads your homepage.

Again, we need to test further, but initial signs shows that it is working... oddly, our PageSpeed stat is lower/worse with this enabled. I think we need to tweak some of our settings... maybe regenerate our .htaccess file and tweak our server.

HTH!

philee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 339 posts

Posted 31 October 2011 - 02:53 AM

Sounds very vigorous to get it set-up. How much is it going to cost you monthly to have Amazon CDN service for your store?

mytheory.

    PrestaShop Apprentice

  • Members
  • PipPip
  • 416 posts

Posted 01 November 2011 - 05:26 AM

Hi,

Actually it was very easy to setup... i just went into a lot of details. Just sign up, answer a few questions to create a distribution, and then copy the domain that is automatically generated Amazon into your Media Server 1 field in the BO. Save and done and done.

Cost... not sure yet... according to Amazon's site it says the first 10TB is rated at 0.12 cents a GB. And then the next 40TB at .08 per GB, and so on. I should have a better estimate at the end of this next month.

HTH!

philee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 339 posts

Posted 01 November 2011 - 08:34 AM

Hi,

I checked your site. Shouldn't your media files be hosted on a subdomain that says CDN?

mytheory.

    PrestaShop Apprentice

  • Members
  • PipPip
  • 416 posts

Posted 01 November 2011 - 10:18 PM

Hi,

Sorry... since our recent update, we've been making minor adjustments to our site, so to do efficiently we have disabled the PS performance features temporarily.

Just a word to the wise... we noticed that when making adjustments with performance features on some changes were not immediately reflected even after a clearing the cache. We noticed that the CDN was serving cached versions of our images and static files, so to make proper, immediate adjustments you may want to disable these features for the time being. If you change the names on the files (which isn't often) then it's ok... but for example images if you adjust the size but upload it using the same name than the change won't take affect im guessing until the cache of the CDN is refreshed. On the bright side, at least we know the CDN and performance features are working!

And YES, you will see a cloudfront.net address in the status when the pages are loading... that is of course, after we re-enable these features. We hope to have this enabled again by later today/tonight.

HTH!

philee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 339 posts

Posted 08 November 2011 - 02:36 PM

Great write-up progress. :)

I am going to have CDN running on my store really soon.

PrestaMagic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 74 posts

Posted 16 December 2011 - 01:31 AM

OK what may be a dumb question, but here goes....

Do images get magically placed on the media server as specified in the BO by PS or do I have to put them up there somehow?
We make helpful PrestaShop modules and themes for people who want to convert casual browsers into life-long customers.

Our work is based on our real-life online PrestaShop and over 15 years of e-commerce experience. PM me if you want a link to to our shop so you can see what we do in action.

mytheory.

    PrestaShop Apprentice

  • Members
  • PipPip
  • 416 posts

Posted 16 December 2011 - 01:49 AM

Not a dumb question at all... quite frankly I still am not 100% sure how it works. BUT... no I did not have to upload anything to my server or to CloudFront.

Basically you set up the distribution on Amazon's side, then you tell PS via the BO the media server domain name (aka amazon cloudfront distro) and that's it.

It appears PS is set up to automatically do it's thing as far as serving images and static files via the defined media server(s).

I remember somebody saying (in a different post) that some files were not included in the CDN (ie. media and static files from third party modules, etc)... so it appears that PS's code has a set of specific folders that it tells to serve via CDN if that feature is properly set up. I'm still trying to figure out if all my static content is being served through cloudfront (highly doubt it), but in any case I do know that a good amount of content IS properly being served over the CDN. For example, I can see the cloudfront address serving content when a page loads, and my product images point to my cloudfront distro and not directly from my domain as before.

HTH!

PrestaMagic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 74 posts

Posted 16 December 2011 - 04:01 AM

Awesome! Thank you so much for your thoughtful comments. I'll be setting this up in the next few days and will report back as to my understanding. We've used the Amazon product for a while now on some other sites, so this will be great on PS.
We make helpful PrestaShop modules and themes for people who want to convert casual browsers into life-long customers.

Our work is based on our real-life online PrestaShop and over 15 years of e-commerce experience. PM me if you want a link to to our shop so you can see what we do in action.

michaelchan0427

    PrestaShop Apprentice

  • Members
  • PipPip
  • 51 posts

Posted 22 December 2011 - 09:58 AM

Hi,

Why don't you take a look at the CDN article ?? Full content link: http://prestashopexc...ould-i-use-cdn/





EDIT



Table Of Content

Introduction
Should I use CDN?
How CDN works
The Request Cycle


How does CDN invalidate cached objects?


Performance Impact


What would slow a Prestashop e-commerce site down?
Is CDN the answer to performance?
Increasing shop performance
Move off shared hosting


Optimizing PHP, Apache and MySQL


Final words


Introduction

This article steams from a user question about the use of CDN and related questions around the CDN topic. The question is actually very simple but the, user, like many other Prestashop site owners, do not realize that there are more important ares needs to be considered before adopting a CDN. In this article, we will discuss whether or not CDN is appropriate for Prestashop e-commerce sites, alternatives to CDN and background technical knowledge
Should I use CDN?

This is probably not the first question Prestashop owners (shop owners) ask when starting an online shop, but will definitely be the one of the most popular questions shop owners ask themselves when the following happen:
  • Growing amount of traffic, and predicted that additional capacity will be required in the near future.
  • Obvious degrade in performance, especially during peak trading hours.
  • Sometimes it is even worse, the whole site simply stop responding or takes too long to respond.
  • Exceeding bandwidth limit, and the ISP is charging a lot of $$ per GB.
The most obvious answer to the above seems to be Media Servers (or CDN) for PrestaShop owners. Since this is readily available from the Performance configuration screen, but how does it work? How will CDN improve the performance of your site? And more importantly, does it really helps and do you really need it?? Read on and find the answers below.
Find your answers at perstashopexchange.com, the one and only Q&A style Prestashop knowledge base.Take a look at our FREE ADDONS!!.

PrestaMagic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 74 posts

Posted 23 December 2011 - 08:44 PM

lol, you're funny. in your article you say "the technical details have been dropped" - that's exactly what I am after. I don't see how this works without moving images to the CDN servers.
We make helpful PrestaShop modules and themes for people who want to convert casual browsers into life-long customers.

Our work is based on our real-life online PrestaShop and over 15 years of e-commerce experience. PM me if you want a link to to our shop so you can see what we do in action.

michaelchan0427

    PrestaShop Apprentice

  • Members
  • PipPip
  • 51 posts

Posted 27 December 2011 - 01:39 AM

you just don't understand, isn't it? have you looked at the content of the link? It has the full request life cycle and I don't call this technical. You don't need to move / copy images because this is dealt with automatically. Please do not use "what you have seen" to try and understand something much more complex than you think.

When I say technical details, I mean multiple edge servers / global load balancers / firewall / distributed caching / DNS with Geo Location, etc, etc.

Are you after the details of how the entire infrastructure can be implemented? Or do you call using SFTP to upload files "technical"?
Find your answers at perstashopexchange.com, the one and only Q&A style Prestashop knowledge base.Take a look at our FREE ADDONS!!.

PrestaMagic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 74 posts

Posted 27 December 2011 - 02:19 AM

You're awesome.
We make helpful PrestaShop modules and themes for people who want to convert casual browsers into life-long customers.

Our work is based on our real-life online PrestaShop and over 15 years of e-commerce experience. PM me if you want a link to to our shop so you can see what we do in action.

chetwyn

    PrestaShop Apprentice

  • Members
  • PipPip
  • 139 posts

Posted 24 May 2012 - 10:58 AM

This sounds exactly what I'm looking for. Couple of questions.

1. what version of prestashop are you running?
2. so you didn't need to transfer any file to

Amazon CloudFront



To confirm. You signed up. entered the media address and all worked?



3. did it work

immediately

4. how many media servers did you use, all 3 or just one?


Got the bug for Presta and run a cool handbags site. Also run a really cool homeware site. Using plenty of great plugins from the prestashop crew.

Nanuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 118 posts

Posted 25 July 2012 - 03:20 AM

Not a dumb question at all... quite frankly I still am not 100% sure how it works. BUT... no I did not have to upload anything to my server or to CloudFront.

Basically you set up the distribution on Amazon's side, then you tell PS via the BO the media server domain name (aka amazon cloudfront distro) and that's it.

It appears PS is set up to automatically do it's thing as far as serving images and static files via the defined media server(s).

I remember somebody saying (in a different post) that some files were not included in the CDN (ie. media and static files from third party modules, etc)... so it appears that PS's code has a set of specific folders that it tells to serve via CDN if that feature is properly set up. I'm still trying to figure out if all my static content is being served through cloudfront (highly doubt it), but in any case I do know that a good amount of content IS properly being served over the CDN. For example, I can see the cloudfront address serving content when a page loads, and my product images point to my cloudfront distro and not directly from my domain as before.

HTH!


Hi! Do you have any new suggestion since it's passed a while? :)

I've just configured CDN following your advices on CloudFront and seems to going well.

Did you made 3 copyes of the same domain and then put the domain name that CloudFront gives to you into the CCC boxes or you did something different?

Also, anyone knows how to set more than 3 CDN with that system?

Thanks!

NP






Also tagged with one or more of these keywords: cdn, prestashop cdn, cloudfront, amazon cloud front

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users