How You Guys Manage Contents That Upload To Amazon Ec2?

Hi all,

As you know that there is a chance that EC2 could destroy self-instance and recreate new instance from the image(image with site that already set up).

And when CS-Cart is launching. the framework only allow to upload incoming images to the host itself.

So there is a chance that when current instance is destroyed and recreate. The current content data from the previous instance will be gone.

So I want to know how you guys handle this issue. Is using cdn (cloudfront) help solving this problem? but I see that cloudfront still have origin on cscart host, and I'm not sure it will fix the issue. (I thought it will clone data to base on S3).

Or do I understand things wrong? please share how you guys fix this. Thanks in advance!

EC2 has caching issues as it relates to propagation delays. I.e. FTPing a change to a file might take a couple of seconds or even a couple of minutes to be visible.

Turning off APC caching seems to help considerably.

Using cloudfront won't help you at all. EC2 already does it's own cdn.

Hi tbirnseth,

Did you implement any solution to upload any static resources such as product's images or files to other data hosting server other than CS-Cart application itself? If you have done that before I would like you to share your idea.

For me, the possible solution that don't need to modify code at all is the network file system in Linux. Just mount the network path to /path/to/cscart/images and OS will do the rest.

by the way what is the service name of cdn in EC2?, its need to be installed?

I have not. However, there are paid CDN servuces that will allow you to upload static data and then serve it from your site using Apache configuration controls.

I guess I'd ask "what is the problem you are trying to solve"? Are access to your site worldwide? What is the performance of serving your imagery from your storefront? Are you sure you have a latency/distance related problem?

Using cloudflare the static content will be cached automatically.

Do not believe everything that they are writing on their page (especially on free account), but may help in serving static content faster.

Hi tbirnseth,

We are not plan to make it worldwide yet, but the problem is. When EC2 reach it scaling somehow, it will terminate its instance and create new from image. And baam, all the static data on previous instance gone. That's the problem we are aware of.

So to prevent that, we want to make sure that situation won't happen by try to let our site point to other hosting server instead.

The paid CDN you mentioned could you suggest us which service do you use? And how to upload your static data there? As it there are some thumbnail images that will be generated through user clicking on site, will those images will automatically store on that server and act as an origin host too?

I don't use a CDN and I don't use EC2. Neither are necessary for my business. But services like Akami and real commercial CDN services can be configured to meet whatever need you have. I'd just recommend staying away from those who want to capture your DNS (like cloudfare).

Hi tbirnseth,

We are not plan to make it worldwide yet, but the problem is. When EC2 reach it scaling somehow, it will terminate its instance and create new from image. And baam, all the static data on previous instance gone. That's the problem we are aware of.

So to prevent that, we want to make sure that situation won't happen by try to let our site point to other hosting server instead.

The paid CDN you mentioned could you suggest us which service do you use? And how to upload your static data there? As it there are some thumbnail images that will be generated through user clicking on site, will those images will automatically store on that server and act as an origin host too?

There is an option in EC@ instance where it will not terminate itself , make sure you enable that.

When you use https, the connection between the client and the CDN is secure, but the connection between the CDN and your originating site is not.

There are several other reasons why I don't recommend using a CDN at all unless you sell internationally (I.e. a reasonable percentage of your business is from far away).

When doing development on a site that has CDN turned on, propagation delays can double or triple the cost of development by having to wait for whatever the current connection is to update from changes at the originating site. Sites like cloudfare are slow to propagate which is one of the reasons they are free.

Those are a few or MY reasons. If you're a US merchant and you sell mostly in the US, you would see very little benefit from a CDN. It's when you start crossing oceans that delay can become a problem..... There are no hard/fast rules. Just do A/B testing to see how much benefit you get from additional managed services.

[content removed]

You have done more work that most merchants are willing to do. However, it certainly sounds like you thought through the problems have come up with solutions that address most of my concerns related to cloudfront and CDN's in general. But as you say, this was not a simple task nor one that is easily implemented with standard cs-cart. Good work.

[content removed]