# Cache with format

**URL:** <https://www.ruby-forum.com/t/cache-with-format/128507>\
**Category:** Rails\
**Created:** [February 8, 2008, 10:07am UTC](https://www.ruby-forum.com/t/cache-with-format/128507 "2008-02-08T10:07:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@pierre](https://www.ruby-forum.com/u/pierre)\
**Post date:** [February 8, 2008, 10:07am UTC](https://www.ruby-forum.com/t/cache-with-format/128507/1 "2008-02-08T10:07:10Z")

</div>

Hello,

I am using a iphone optimized version of my Rails app as explained here  
:

> **[railspikes.com](http://ww38.railspikes.com/2007/11/8/iphone-subdomains-with-rails)**
>
> Ruby on Rails

Everything is going well, the only problem that I have is with caching.

Because Rails is caching iphone format with the extension .html, that  
does not allow me to cache these files without destroy the regular  
version of the website.

Would someone have any idea of a solution ?

Thank you very much,

Pierre

---

<div class="post-metadata">

**Author:** ![pierre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@pierre](https://www.ruby-forum.com/u/pierre)\
**Post date:** [February 9, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/cache-with-format/128507/2 "2008-02-09T19:32:31Z")

</div>

Pierre P. wrote:

> Hello,
> 
> I am using a iphone optimized version of my Rails app as explained here  
> :  
> [railspikes.com](http://www.railspikes.com/2007/11/8/iphone-subdomains-with-rails)
> 
> Everything is going well, the only problem that I have is with caching.
> 
> Because Rails is caching iphone format with the extension .html, that  
> does not allow me to cache these files without destroy the regular  
> version of the website.
> 
> Would someone have any idea of a solution ?
> 
> Thank you very much,
> 
> Pierre

Hi,

Not much idea for my problem… Impossible ?

---

<div class="post-metadata">

**Author:** ![pierre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@pierre](https://www.ruby-forum.com/u/pierre)\
**Post date:** [February 11, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/cache-with-format/128507/3 "2008-02-11T17:13:28Z")

</div>

I went in caching.rb and change line 150  
#request.path  
request.host + request.path

then adapt your apache conf. to serve the good cache files depending on  
the virtualhost

Pierre

Pierre P. wrote:

> Pierre P. wrote:
> 
> > Hello,
> > 
> > I am using a iphone optimized version of my Rails app as explained here  
> > :  
> > [railspikes.com](http://www.railspikes.com/2007/11/8/iphone-subdomains-with-rails)
> > 
> > Everything is going well, the only problem that I have is with caching.
> > 
> > Because Rails is caching iphone format with the extension .html, that  
> > does not allow me to cache these files without destroy the regular  
> > version of the website.
> > 
> > Would someone have any idea of a solution ?
> > 
> > Thank you very much,
> > 
> > Pierre
> 
> Hi,
> 
> Not much idea for my problem… Impossible ?
