Archive Page 2
Using S3 as a cache store
I’ve written a plugin that uses s3 as a cache store for you rails app. Basically, it allows you to cache content at s3 instead of your own server – continuing the theme of using s3 as an asset server.
The Amazon Web Services blog links to a site using S3 to serve up their static content. The encouraging thing was that informal tests showed no noticable differences between serving it up locally and S3. Very nice.
I noticed the same thing using my soon to be released S3Cache plugin. As I mentioned in a comment to the story that I’m looking for a few good testers to test out this plugin. S3Cache creates a new fragment cache filestore using Amazon’s Simple Storage Service (S3). Instead of your fragment caches stored at say “#{RAILS_ROOT}/cache”, your cache can now be located at one of your S3 buckets.
S3Cache also extends ActionView Helpers by adding a new cache helper called “cache_xml”. This caches xml and rss files at S3. Your rss feed can then be accessed at something like http://steveodom.s3.amazonaws.com/feeds/my_feed.rss.
My main goal is writing this plugin was to offload my xml and rss feeds to S3. This way my server is never touched when these files are accessed. But I found that I could extend it too to the cached elements of my site and page performance not be effected. So in effect most of my application can be served from S3, yet it is still database driven and dynamic.
So if anyone is interested in testing this plugin, before I release it into the wild, let me know and I’ll email them a copy. Preferably you’ll be already using fragment caching on your site.
Filed under: Ruby on Rails, rails, s3 | 8 Comments
Wow. I thought this was an incredibly insightful post on how big deals are being done. It sure looks like Google is on its way to becoming the next Microsoft.
>The second request was to pile some lawsuits on competitors to slow
> them down and lock in Youtube’s position. As Google looked at it they
> bought a 6 month exclusive on widespread video copyright infringement.
> Universal obliged and sued two capable Youtube clones Bolt and
> Grouper. This has several effects. First, it puts enormous pressure on
> all the other video sites to clamp down on the laissez-faire content
> posting that is prevalent. If Google is agreeing to remove
> unauthorized content they want the rest of the industry doing the same
> thing. Secondly it shuts off the flow of venture capital investments
> into video firms. Without capital these firms can’t build the data
> centers and pay for the bandwidth required for these upside down
> businesses.
Filed under: Uncategorized | Leave a Comment
So I’ve just started experimenting with Amazon’s S3 service and boy is it easy. My plan was to use S3 as a media server to serve up my flash widgets and javascripts for my upcoming Quizical.net project. So to do that, I ….
- created an S3 account.
- Dowloaded the S3 Organizer plugin for Firefox.
- Restarted firefox and opened up S3 Organizer.
- Created a “bucket” (basically a new folder). To do this, it is just like creating a folder with an FTP client.
- After my bucket was created (I called it “quizical”), I uploaded the image, javascript, and stylesheet directories of my rails app.
- Using S3 Organizer, I set my permissions to public for these directories, by right-clicking on the file name and setting public in the dialog box and checking the “Apply to sub-folders” box.
- In production.rb in config/environments, I revised this line to point to my asset server:
config.action_controller.asset_host = “http://quizical.s3.amazonaws.com”
Now all of my public files are being served from S3, a true asset server. So simple.
The only thing that threw me off for a second was the terminology used. The bucket reference I got. But the URL structure is listed as http://s3.amazonaws.com/bucket/key. I kept putting in my access key for the /key. Turns out, key is what Amazon calls the filename.
Filed under: Ruby on Rails, s3 | 3 Comments
I made a presentation to the Austin on Rails group last night on my experience the last month refactoring Trivionomy.com to REST. I’ve attached my presentation here.
I will add more text to this post later summarizing my talk.
Filed under: Ruby on Rails, rails | 3 Comments
