rails/rails — Issue #3482: ActionCachePath shouldn't discard http/https
Author: jdelStrother
Created: 2011-10-31 16:31:09+00:00
State: open

Hi,

In https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/caching/actions.rb#L171, the request protocol is discarded.

This results in http://example.com and https://example.com being cached under the same key, which can cause problems if, for example, you're linking to css, which should be http://example.com/style.css on one page and https://example.com/style.css on the other.

The obvious answer seems to be to use the entire url as a cache key, but I guess the answer becomes more complicated if you want to support cache-expiration affecting both versions of the cache.

I can probably hack together a patch if necessary, just wanted to see if anyone had any opinions before I do so...