Search code examples
ruby-on-railsruby-on-rails-4dropbox

Page loads too slow when serving images from dropbox account


I am using dropbox to host my images for my rails app deployed on heroku, but when i request a page it just hangs up for way too long and doesn't responds. Because it waits for GET request for all images which BTW takes way too long and till then page just freeze.

User thinks that nothing is happening and leaves the page.

http://www.shaktimarble.com/makrana_marbles/albeta_marble

I need an opinion how to make this app a bit faster or at least load the page first to make it visible and then load the images on the page so that user doesn't think that nothing is happening.


Solution

  • You should put those images on a CDN (Content Delivery Network). DropBox really isn't a CDN. It's a file syncing and sharing service. I'd almost be willing to bet that DropBox rate-limits downloads from a single IP address.

    Having said all that, you could use JavaScript to load image elements into the DIVs in your page after the page text has rendered, and that might give the illusion that things are a little faster, although the page wouldn't work if the user disables JavaScript.