# Cached pages and content negotiation

**URL:** <https://www.ruby-forum.com/t/cached-pages-and-content-negotiation/150618>\
**Category:** Rails\
**Created:** [October 10, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/cached-pages-and-content-negotiation/150618 "2008-10-10T14:45:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@sebastian](https://www.ruby-forum.com/u/sebastian)\
**Post date:** [October 10, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/cached-pages-and-content-negotiation/150618/1 "2008-10-10T14:45:23Z")

</div>

Hi

I seem to be unable to get the server (Apache 2.0.61 with Phusion  
Passenger 2.0.3) to return cached non-html pages.  
My application caches RDF-XML files in the file system with an .rdf  
extension. The URLs to retrieve the data (I’m using ActiveRecords, not  
ActiveResources) don’t use file extensions, so I am calling  
‘ActionController::Base.page\_cache\_extension = “.rdf”’ from the  
controller. My requests have a header “Accept: application/rdf+xml”  
and I’ve added “AddType application/rdf+xml .rdf” to /  
public’s .htaccess file.  
Albeit the server never returns the cached pages, instead rails sends  
a new response.

When I change the file extension of a cached file to .html and use a  
browser to request the data, the cached file is returned. So some sort  
of content negotiation is at work here, but it only works for html  
caches.

Any ideas, anybody?  
Thanks.  
-Sebastian
