# Caching and optimizations

**URL:** <https://www.ruby-forum.com/t/caching-and-optimizations/65539>\
**Category:** Radiant CMS\
**Created:** [August 18, 2006, 10:30pm UTC](https://www.ruby-forum.com/t/caching-and-optimizations/65539 "2006-08-18T22:30:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frederico\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d9b06d/32.png) [@Frederico\_Oliveira](https://www.ruby-forum.com/u/Frederico_Oliveira)\
**Post date:** [August 18, 2006, 10:30pm UTC](https://www.ruby-forum.com/t/caching-and-optimizations/65539/1 "2006-08-18T22:30:26Z")

</div>

Hey guys,

I looked around and it seems like this hasn’t been asked before, but  
one of my major concerns with Radiant (which I’ve been using for quite  
some time now) is its caching mechanism. Here’s my problem:

I plan on deploying RadiantCMS on websites with content that doesn’t  
change often - it gets updated maybe every week, but never twice in,  
say, a day. This being said, the 5-minute caching mechanism becomes  
useless as all but a few requests are dynamically generated and not  
taken from the cache.

Now for the question: is there a plan to make the caching method used  
by Radiant change, or should I patch the application myself? I can  
predict many others will be in this situation soon as the application  
is considered for real-world use by more and more developers and/or  
companies. In critical situations for pages who get loads of requests  
but little changes, we may have a problem.

Thoughts or solutions?

Fred

–  
Frederico Oliveira  
Webreakstuff - A design, development and usability consulting company  
[http://webreakstuff.com](http://webreakstuff.com) | removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Frederico\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d9b06d/32.png) [@Frederico\_Oliveira](https://www.ruby-forum.com/u/Frederico_Oliveira)\
**Post date:** [August 18, 2006, 10:45pm UTC](https://www.ruby-forum.com/t/caching-and-optimizations/65539/2 "2006-08-18T22:45:28Z")

</div>

Frederico Oliveira wrote:

> Now for the question: is there a plan to make the caching method used  
> by Radiant change, or should I patch the application myself? I can  
> predict many others will be in this situation soon as the application  
> is considered for real-world use by more and more developers and/or  
> companies. In critical situations for pages who get loads of requests  
> but little changes, we may have a problem.

I don’t have plans to change the caching mechanism. Are you really  
experiencing that much load that regenerating the page every five  
minutes or so is a problem? I would find that really, really surprising.  
If you were you could probably afford to buy new hardware or approach  
the issue from a different angle.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Frederico\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d9b06d/32.png) [@Frederico\_Oliveira](https://www.ruby-forum.com/u/Frederico_Oliveira)\
**Post date:** [August 18, 2006, 11:06pm UTC](https://www.ruby-forum.com/t/caching-and-optimizations/65539/3 "2006-08-18T23:06:29Z")

</div>

On 8/18/06, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I don’t have plans to change the caching mechanism. Are you really  
> experiencing that much load that regenerating the page every five  
> minutes or so is a problem? I would find that really, really surprising.  
> If you were you could probably afford to buy new hardware or approach  
> the issue from a different angle.

It ultimately depends on the site’s usage patterns. In a packed  
environment (like shared hosting), it may become a big concern - if  
most page requests are non-cached, CPU usage for dispatchers goes way  
up when taking hits (possibly blowing up CPU-time limits).

It is a fact that most people wont run into this sort of situation,  
but those I describe on the above paragraph might. Naturally most  
people with critical pages will choose to run them on dedicated setups  
(possibly even balanced environments), so it wont become a liability.

Still, giving users the chance to change the ResponseCache expiry  
times in, say, a config file would be a safe bet. Naturally anyone can  
change the ResponseCache model and do it themselves (like I have, for  
pages who don’t get too many updates - since there’s a clever Clear  
Page Cache button to override the expiry time), but maybe that’s one  
of the things where configuration comes in handy for people who’ll be  
deploying a lot of pages.

Fred

---

<div class="post-metadata">

**Author:** ![Frederico\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d9b06d/32.png) [@Frederico\_Oliveira](https://www.ruby-forum.com/u/Frederico_Oliveira)\
**Post date:** [August 18, 2006, 11:30pm UTC](https://www.ruby-forum.com/t/caching-and-optimizations/65539/4 "2006-08-18T23:30:31Z")

</div>

Frederico Oliveira wrote:

> Still, giving users the chance to change the ResponseCache expiry  
> times in, say, a config file would be a safe bet.

Actually, you can do that. Just drop the following in  
config/environment.rb:

ResponseCache.defaults[:expire\_time] = 2.days

There are a couple of other defaults that you can use to configure  
caching. They are listed at the top of this file:

[http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/response\_cache.rb](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/response_cache.rb)

But I must ask: Is this actually an issue for you or are you  
anticipating that it might be? I ask because I believe that a lot of  
people make assumptions about caching based on what was once required on  
old hardware. I believe that modern hardware has changed the game and  
CPU time is no longer an issue for all but mega Web sites.

Jason Hoffman did a study on Radiant and caching and posted some  
interesting screenshots about it on Flickr:

[http://flickr.com/photos/textdriveinc/179393665/in/photostream/](http://flickr.com/photos/textdriveinc/179393665/in/photostream/)

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Frederico\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d9b06d/32.png) [@Frederico\_Oliveira](https://www.ruby-forum.com/u/Frederico_Oliveira)\
**Post date:** [August 21, 2006, 5:35pm UTC](https://www.ruby-forum.com/t/caching-and-optimizations/65539/5 "2006-08-21T17:35:43Z")

</div>

On Aug 18, 2006, at 16:29, John W. Long wrote:

> Jason Hoffman did a study on Radiant and caching and posted some  
> interesting screenshots about it on Flickr:
> 
> [7 million on radiant behind a BIG-IP: throughput, connecti… | Flickr](http://flickr.com/photos/textdriveinc/179393665/in/photostream/)

I _know_ Jason loves testing their Sun/Solaris platform 🙂

What kind of server/cluster was that test performed on?

13 mongrels in a Pound? Where is the HTTP server for static files?

\*Mars

( \<\> … \<\> )
