2

Some of you may have a solution for this, and I need to hear it. Basically, you have a website, a lot of categories ( games, blog etc ).

The idea would be to use Amazon CDN for images, flv's, javascript js, and css. What's the best way to implement Amazon CloudFront to make this work?

Would I sync only the images etc, keeping the structure intact? I've been using

RewriteEngine On
RewriteCond %{REQUEST_URI} .*jpg$|.*gif$|.*png$ [NC]
RewriteRule (.*) http://www.google.com/$1 [R]

in order to server images, but also keeping the relative paths. So

domain.com/images/something/smth.jpg

would redirect to

etc.cf.net/images/something/smth.jpg

The idea is to make no changes to the website. I'm not sure if to not kick s3fs directly to the image directories, and have everything upload to the respective mount points ( is the speed fast enough ? )

2
  • Why are you considering implementing CloudFront? What are you trying to achieve here? Jun 22, 2010 at 20:34
  • This is related to alot of SEO stuff, ranking etc.
    – Adrian A.
    Jun 23, 2010 at 16:37

2 Answers 2

2

Not really the best use of a CDN.. the idea is to take requests away from your webserver.. All that will do is remove the bandwidth.

Its better to change the code itself to take the request for the images out of the webserver.

1
  • 1
    If that were possible, I wouldn't be asking for ideas on alternative solutions :)
    – Adrian A.
    Jun 23, 2010 at 16:36
1

You could use some output buffering and cache to process all links and change them to the CF CNAME before being sent to the client. Then set-up a custom origin CF pointing to your standard domain.

This will require no other changes and will route all traffic for static content to CF but actually leaving the original content on the same server as is.

The above could also be achieved client-side with some DOM manipulation using Javascript.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .