By Horst Fuchs on Sunday, 11 May 2014
Posted in General Issues
Likes 0
Views 743
Votes 0
Hi,

is it possible to use the CDN function with Amazon? Is there a documentation how to use it?

Thanks for your support!
Hello Horst,

CDN is different than Amazon S3. Amazon S3 is a remote storage as opposed to a CDN. CDN stores your files in their POP servers and CDN are normally used to serve assets files like css, js. You can find the docs at http://docs.stackideas.com/administrators/remote_storage/setup_amazon
·
Sunday, 11 May 2014 15:51
·
0 Likes
·
0 Votes
·
0 Comments
·
....marke it as solved - just found the documentation. Hopefully it works
·
Sunday, 11 May 2014 15:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

yes you are right - thanks for the link!
·
Sunday, 11 May 2014 15:54
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Sunday, 11 May 2014 16:05
·
0 Likes
·
0 Votes
·
0 Comments
·
I would like to chime in here and state that serving files from S3 is NOT ideal. S3 is a storage medium, not a content delivery medium, and a busy site can quickly rack up some nasty access costs if the files are being accessed frequently. The ideal setup is to STORE the images on S3 and SERVE images through CloudFront (or another CDN). The CDN can be set to cache the S3 origin for one or ten years, thus practically eliminating Amazon costs for GET requests to S3. Plus the CDN delivers the images from the closest node to the user, unlike S3 which is restricted to the bucket's region.

This would require the CDN URL setting in ES admin to also rewrite the paths to the images (or a new setting for S3 CDN URL yes/no and a field for the CDN URL), and I believe it is the best way to use remote storage. I helped Alejandro at jReviews code and debug this same feature in jReviews, and with 16,667 S3 images served through CloudFront on a site that gets 55,000 visitors per month, my combined storage/delivery costs are less than $10/month, and that includes all images, JS, and CSS on the entire site. The S3 chunk of that is usually a mere $0.50!!!
·
Friday, 01 August 2014 05:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing this Steven By the way, what is the cost prior to these changes?
·
Friday, 01 August 2014 16:59
·
0 Likes
·
0 Votes
·
0 Comments
·
I couldn't tell you since I never used S3 as a media delivery service without CloudFront, but a quick spin on the AWS calculator gives me approx $1.50 for US Virginia and $2.00 for South America -Sao Paulo (which is where my EC2 instance is hosted). Granted, $1.50 is nothing, but then again 200,000 GET requests per month is not that much. If I used CloudFlare I would be only paying for S3!

The other nice thing about rewriting the S3 images to a CDN URL is that you can deliver it with cdn.domain.com instead of that nasty AWS domain name!

Just some thoughts and thanks for listening.
·
Friday, 01 August 2014 17:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for the heads up on this Steven, good share
·
Friday, 01 August 2014 23:17
·
0 Likes
·
0 Votes
·
0 Comments
·
So, any chance we might see new settings for image CDN delivery from S3 (one for http and one for https)? Otherwise point me to the file that generates the media URL and I will hack it for testing purposes if you want.
·
Friday, 08 August 2014 18:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Really interesting. Subscribed.
·
Friday, 08 August 2014 19:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Subscribed.
·
Friday, 08 August 2014 22:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Steven,

Hm, not really sure about the multiple http:// and https:// sources. What do you mean by this?
·
Saturday, 09 August 2014 01:42
·
0 Likes
·
0 Votes
·
0 Comments
·
I mean that there are two cdn possibilites

1) The masked cdn like cdn.mysite.com using a CNAME to mask cloudfront.net over http
2) The raw cloudfront.net cdn for use over https (Amazon charges hundreds per month to have your own domain name served over https through cloudfront).

Wherever ES is checking local or remote storage, if remote storage is detected, there would be another check, to see if CDN is being used or not. If no, the regular S3 URL is used. If yes, the http cdn url is used (if http) or the https cdn url is used (if https). Check the screenshot to see how this is set this up in jReviews admin.

We have nice CDN URLs and practically zero S3 costs (my cloudfront costs are a bit high because 90% of my users are from Argentina which pulls the CloudFront files from an expensive region) on my site. Plus a CDN is MUCH faster than getting from S3. All-in-all, a much more professional presentation avoiding using the ugly S3 URLs.
·
Saturday, 09 August 2014 02:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Steven,

You can edit the file /administrator/components/com_easysocial/includes/storage/adapters/amazon/amazon.php to replace the urls that is being served under the getPermalink method. This is assuming that you are storing your files on Amazon and serving it with a CDN.
·
Saturday, 09 August 2014 14:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Subscribed.
·
Friday, 22 August 2014 21:30
·
0 Likes
·
0 Votes
·
0 Comments
·
subscribe button please!
·
Friday, 22 August 2014 22:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Noted, we'll try to add this to the forums
·
Saturday, 23 August 2014 14:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Funny you posted here today, I was JUST NOW messing around with this & CDN for Joomla. I haven't had time to "hack" the file yet, but I did manage to get it working with CDN for Joomla.

Site Root: https://s3-sa-east-1.amazonaws.com/bucket-name
CDN Domain: blahblahblah1.cloudfront.net

The reason I couldn't get it working before is because apparently CloudFront does not like you adding S3 buckets as origins to an existing S3 distro. So I created a new one with my ES bucket as the origin and now it works.

Now, the problem with CDN for Joomla is it only has room for 5 CDNs, so anyone using https like me are restricted to two CDNs, because each one actually needs two slots: one slot for media.mydomain.com and one slot for the raw cloudfront.net domain over https (remember it costs hundreds of dollars to have a custom SSL cert on CloudFront).

So, non-urgent feature request: setting in admin to re-write s3 bucket URL replacing it with CDN url, one field for http and one field for https.
·
Saturday, 23 August 2014 22:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Well done Steve, great idea! Thanks!
·
Sunday, 24 August 2014 02:47
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post