Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:11:39+00:00 2026-06-06T14:11:39+00:00

I have a Rails 3 application that needs to display images from another application.

  • 0

I have a Rails 3 application that needs to display images from another application. Those images change over time, so I have a task that runs hourly to check for changes. For performance reasons, I want to create a sprite with those images that I serve from my own application (so 1 image and 1 css file).

Ideally, I’d like Sprockets to handle these files in the same way it does any of my other images and stylesheets in my application so I don’t have to roll my own minification, gzip, caching, etc solutions.

Is there a way to hook into Sprockets at runtime so that I don’t have to stop my server, precompile, and start the server again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:11:40+00:00Added an answer on June 6, 2026 at 2:11 pm

    I was unable to find any way to hook into sprockets.

    For those who are curious, I solved this problem in the following way (but left out the minification/gzip piece, since the tiny performance boost doesn’t justify the complexity):

    1. Create the sprite files as usual.
    2. Determine the md5 hash value for the image.
    3. Copy the new files to the public folder using the md5 hash value as part of the file name.
    4. Send the new files to all servers in the cluster.
    5. Update a configuration variable on all servers to know which file to serve (e.g. MyApp::Application.config.tool_icon_md5_key).
    6. Remove old files from all servers in the cluster.

    The clustering is actually the most difficult piece. The key there is avoiding the case where one server requests the new file but the server that handles that request doesn’t actually have that file yet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Ruby on Rails application that needs to find a home in
I have a silverlight application that needs to talk to a rails app to
I have a rails application that occasionally needs to do very slow network calls
I currently have a Ruby (Rails) application that needs to make a lot of
I have a Rails application with database that is updated from external C++ program.
I have an iOS application that authenticates to a Rails application. The first time
I have a Rails application that uses ActiveRecordStore for sessions. I need a PHP
I have a Rails application that accepts file uploads of CSV files. When developing
I have a rails application that about 3 years old, and I'm having a
I have a Rails application that lists information about local services. My objectives for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.