# Subdomain-based page caching?

**URL:** <https://www.ruby-forum.com/t/subdomain-based-page-caching/155542>\
**Category:** Rails\
**Created:** [December 13, 2008, 6:23am UTC](https://www.ruby-forum.com/t/subdomain-based-page-caching/155542 "2008-12-13T06:23:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![avramd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aca169/32.png) [@avramd](https://www.ruby-forum.com/u/avramd)\
**Post date:** [December 13, 2008, 6:23am UTC](https://www.ruby-forum.com/t/subdomain-based-page-caching/155542/1 "2008-12-13T06:23:55Z")

</div>

Hello,

I just wanted to verify my understanding; As of rails 1.2, it was  
impossible to have independent page caches on a per-domain basis,  
right? In other words, if a single rails app responds to both  
[http://foo.com/index.html](http://foo.com/index.html)  
and [http://bar.com/index.html](http://bar.com/index.html), and uses page caching, it _must_  
deliver the same page from cache for both of these requests.

I’m assuming this b/c cached pages supposedly never invoke your rails  
code, so there is never an opportunity for your app to differentiate  
the location of the cached files based on the domain.

Is this understanding correct? Or is there a way to get  
[http://foo.com/index.html](http://foo.com/index.html)  
and [http://bar.com/index.html](http://bar.com/index.html) to be page-cached independently?

If not for Rails 1.2, then how about for any newer versions? I’m not  
up to date on the 2.x capabilities.

Thanks,  
Avram

So, if there was nobody else when God said “Let there be light,” was  
He talking to Himself? Does that mean He is insane? Because that would  
explain a lot
