2

We have a rails 3 application (3.2.12) on which we wish to implement full page caching (Using ActionController caches_page)

We are using _url url helpers everywhere in the application, and this is causing the links in all of the cached pages (in production) to have the domain: http://0.0.0.0/

We have canonical links on several pages that require the domain in the links, so we can't easily switch to _path url helpers.

I've scoured Google and StackOverflow and can't find an answer for this.

I'm not passing in any options to caches_page

The pages are essentially like so:

class SomeController < ApplicationController
  caches_page :index, :other_action

  def index
  end

  def other_action
  end
end

How do I make the links in the generated cache pages have the correct domain?

silasjmatson
  • 1,814
  • 18
  • 37

1 Answers1

0

Perhaps you are caching the pages locally (with them written to the "public" directory), and then deploying everything including the "public" directory to the production site, causing the development pages to be served from production.

Dan Wich
  • 4,923
  • 1
  • 26
  • 22
  • This isn't happening. When I do a tail -f of the logs, I can see the cache page being generated on the first hit. When I remove the cached page, the next hit recreates it. – silasjmatson Feb 27 '13 at 23:06
  • Ok, maybe someone else will have an insight. I would be curious what happens with a nearly-empty controller with one action set to `caches_pages` and one normal action, along with a single `p foo_url(Foo.all.first)` in their views, just to make absolutely sure it's a caching issue. – Dan Wich Feb 28 '13 at 02:57