Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
caching Radiant::Config
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jim Gay  
View profile  
 More options Mar 16, 2:24 pm
From: Jim Gay <j...@saturnflyer.com>
Date: Mon, 16 Mar 2009 14:24:39 -0400
Local: Mon, Mar 16 2009 2:24 pm
Subject: caching Radiant::Config
I'm attempting to remove unnecessary calls to the database for  
Radiant::Config (since it doesn't really change that often)

I've created a config_cache branch where I'm trying to solve this and  
would love some feedback.
http://github.com/saturnflyer/radiant/tree/config_cache

I talked to Sean on IRC a week or two ago about it and we came up with  
the idea to track the mtime on a file in the cache directory so that  
multiple threads could know when to load the data from the database.

Originally I just created a hash in memory:
http://github.com/saturnflyer/radiant/commit/2ede58677fca068f57f9f981...

But then I thought I might as well use Rails.cache:
http://github.com/saturnflyer/radiant/commit/bf974903e835693ae96302ad...

(I realize now that I used "fetch" in my specs where it ought to be  
"read")

I believe I've got the problem covered:

Only load the records from the database if the cache is stale.
Nullify the cache when the page cache is cleared
Recreate the cache when a Config object is saved

Does anyone see where I may have missed something?

-Jim


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google