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

  • Home
  • SEARCH
  • 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 8332759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:48:53+00:00 2026-06-09T02:48:53+00:00

My production environment – # Code is not reloaded between requests config.cache_classes = true

  • 0

My production environment –

# Code is not reloaded between requests
  config.cache_classes = true
  config.assets.enabled = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = true
  config.static_cache_control = "public, max-age=31536000"

  # Compress JavaScripts and CSS
  config.assets.compress = true
  config.assets.js_compressor  = :uglifier
  #config.assets.css_compressor = :yui

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

  # Generate digests for assets URLs
  config.assets.digest = true

  # See everything in the log (default is :info)
  config.log_level = :warn
  config.log_tags = [:remote_ip, lambda { |req| Time.now }]

  # Enable serving of images, stylesheets, and JavaScripts from an asset server
  ActionController::Base.asset_host = Proc.new { |source|
    unless source.starts_with?('/stylesheets' || '/javascripts')
      "//dddd.cloudfront.net/"
    end
   }

However, when I using image_tag it still returns me ‘/assets..’ relative url and not absolute url to the asset host.

irb(main):034:0> helper.image_tag('noimage.gif')
=> "<img alt=\"Noimage\" src=\"/assets/noimage.gif\" />"
irb(main):035:0> helper.image_path('noimage.gif')

I can not seem to figure what might be missing. I even tried doing simple config.asset_host setting, and still it does not recognize the setting.

  • 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-09T02:48:54+00:00Added an answer on June 9, 2026 at 2:48 am

    Have you tried setting the designated config?

    config.action_controller.asset_host = 'https://abcd.cloudfront.net'
    

    Not sure it works with protocol relative urls. I simply use https in my apps.

    It might also be worth noting that action mailer has a similar setting:

    config.action_mailer.asset_host = 'https://abcd.cloudfront.net'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting an error in my production environment but not in my development.
On a production environment, how can one discover which Asp.Net http requests, whether aspx
I get this error only in production environment: FbGraph::Exception: Unparsable Response: when I call
Rails is giving a 500 error (in a production environment using Passenger). The production
In our production environment of 12 servers we have an issue with the code
On my production environment (win2008) I get 400 error (Request Error), The server encountered
Planning of using t4 template in a production environment. I have not used this
On our production environment users are unable to register. They receive: An error has
I get the following error in the production environment Session state can only be
How can we enabled SQL query logging in production environment? Thanks, Imran

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.