Delayed upload delivery to S3 with Paperclip + Delayed::Job

posted Jul 7th, 2009 by Jared

One of the most common features to be added to Rails apps is the ability to handle file uploads. A lot of developers are also storing these uploads on Amazon’s S3 service due to its low maintenance, cost and ease of mind. Plugins like Attachment Fu and Paperclip make this dead simple.

But there is a problem with this. When a user uploads a file, the attachment is sent along with the request, the server receives the request and does whatever it needs to do, and then the attachment is uploaded from the server to S3. All the while the user is still waiting on a response and your mongrel or passenger instance is blocked from taking any other requests. This isn’t a very good user experience especially if your handling large uploads, and even worse, if S3 fails to respond or drops the connection the user will have to re-upload their file regardless of wether or not it is already on your server.

Read the Full Article → 11 comments

 
  • Introducing WeatherMan, a Ruby Gem.

    posted Sep 30th, 2008 by Jared

    So, I was looking into using RWeather by Carlos Kozuszko which is a Ruby Gem for accessing the Weather Channel, inc. XML API. I need to display the weather for various regions in Italy for a project I’m working on. The only problem with RWeather is that it doesn’t currently implement the whole API functionality, most importantly of which is forecasts.

    No big deal, I’ll just implement that in RWeather and submit a patch, I thought. But when I dived into the code to do that, I couldn’t find an obvious spot for adding forecasts in RWeather’s OO hierarchy. RWeather was obviously designed for getting current weather conditions first and foremost. I also didn’t really like the way locations were handled.

    So, I decided to create my own Ruby Gem(my 1st one!). Introducing WeatherMan!

    Read the Full Article → 8 comments

  • Out of the shadows and into a ... blog

    posted Apr 6th, 2008 by Jared

    I’ve finally done it. I finally created my own blog, a place to share my experiences, thoughts, and rants on all sorts of web development stuff.

    Here, I will probably share my experiences in building websites with ruby, rails, php, and web standards.

    I know, I know… the last thing this place needs is another blog. But hopefully, someone will find these posts useful or at least comically absurd.

    So, I guess its time to start the show.

    Read the Full Article → 3 comments