# How to cache dynamic CSS (RCSS)?

**URL:** <https://www.ruby-forum.com/t/how-to-cache-dynamic-css-rcss/134836>\
**Category:** Rails\
**Created:** [April 15, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-cache-dynamic-css-rcss/134836 "2008-04-15T15:20:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [April 15, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-cache-dynamic-css-rcss/134836/1 "2008-04-15T15:20:40Z")

</div>

Hi,

I’m using this tutorial:  
[http://blog.hasmanythrough.com/2006/3/23/dirt-simple-rcss-templates](http://blog.hasmanythrough.com/2006/3/23/dirt-simple-rcss-templates)  
to make dynamic CSS files. However I can’t figure out how expire  
cached CSS files.

Here’s my code: [Parked at Loopia](http://pastie.caboo.se/181021). Most of it is copied  
from the tutorial.

Files are cached properly - i.e.  
\<%= stylesheet\_link\_tag “main” %\> generates “public/stylesheets/  
main.css” file

but when trying to expire it - the following file is expired (from  
logs):  
Expired page: /admin/stylesheets/rcss?rcss=main.html (0.00007)

How to fix it? Thanks in advance
