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 6782607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:45:49+00:00 2026-05-26T16:45:49+00:00

I have deployed a Rails application on Heroku (web-server thin). When I push it,

  • 0

I have deployed a Rails application on Heroku (web-server thin).

When I push it, I can see that the assets are properly precompiled
(Running: rake assets:precompile)

However, when I go to the my app site, and I browse between two pages with the same precompiled header

<head>
<-- ... other stuffs ... -->  
  <script src="/assets/application-5452d0cdbf85c04748c35fac325cd1d7.js" type="text/javascript"></script>

</head>

I can see (Chrome confirmed it [note: disable cache is set to :no on the developer tools] and Safari & Firefox same slowness) that the file is reloaded.

Heroku logs are confirming it

Heroku logs
2011-11-03T11:03:08+00:00 app[web.1]: cache: [GET /assets/application-5452d0cdbf85c04748c35fac325cd1d7.js?_=1320318188543] miss

From browsing on several website, it seems the for static content the setting need to be done at the level webserver, and on the ruby docs it is explained how to do for apache (http://guides.rubyonrails.org/caching_with_rails.html).

It’s the responsibility of the web server you use to set the far-future expiration date on cache assets that you need to take advantage of this feature. 

Any experience with thin and how to configure the expiry on the js assets?

thanks

  • 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-05-26T16:45:50+00:00Added an answer on May 26, 2026 at 4:45 pm

    After two days of research, I found out what was wrong.

    The "responsible" is jquery and the way it handle Ajax calls

    jQuery.ajax()

    cacheBoolean Default: true, false for dataType ‘script’ and ‘jsonp’ If set to false, it will force requested pages not to be cached by the browser. Setting cache to false also appends a query string parameter, "_=[TIMESTAMP]", to the URL.

    Adding the following code fixed my issue

    <script>
            $.ajaxSetup({ cache: true});
    </script>
    

    Then the browser is able to reload it properly (I can see in the developer tool for that specific javascript : Size (from cache) – Time: 11ms).
    Furthermore, the way rails is signing the precompiled assets will allow me to have them properly reloaded if I’ll make a modification on the javascript (tested as well, the included in the header changed from

    <script src="/assets/application-158fadc43ade74e58a8087ec8b95e760.js" type="text/javascript"></script>
    

    to

    <script src="/assets/application-5452d0cdbf85c04748c35fac325cd1d7.js" type="text/javascript"></script>   
    

    This is exactly the behaviour I was expecting and looking for.

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

Sidebar

Related Questions

I have a rails application deployed that works fine in Safari, Firefox, and Opera.
I have a Ruby on Rails app that I've recently deployed to a remote
I have deployed a new build on Production server, but I dont see the
I have deployed my application on server and Now I am getting this error:
i have just deployed my rails application but the css stylesheet wont appear I'm
I have deployed a rails 3.1 app to Heroku Cedar stack, and am trying
I'm using Ruby on Rails 3 deployed at heroku. Now I have working fine
I have a Rails app deployed on Heroku and I have a git repo
I have an existing Rails app on GitHub and deployed on Heroku. I'm trying
I have a rails app deployed to heroku. I have used paperclipftp to upload

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.