LGF Technical Update - Caching In

Charles Johnsonfollow me on twitter
Sat Mar 17, 2007 at 5:36 pm PDT • Views: 214

To decrease the load on our main server, and help us to better handle peak traffic times on weekdays, we now have a five minute cache on the front page, and a 15 minute cache on individual entry pages that don’t show comments.

Judging from emails I received, some of you have noticed that this results in the comment count and last commenter’s name (at bottom right of each post on the front page) being slightly out of date. Yep. It does get slightly stale, because it’s only generated once every five minutes, instead of every time the page is loaded. I’m thinking about an Ajax-based alternative that will work even in cached pages; it’s on the LGF Makeover to-do list.

Another effect of the caching code is that our user preferences page (that lets you set font faces and sizes) has become worthless, because it was based around server-side code that set those preferences each time the page was loaded. Again, an Ajax-based approach will probably let me reinstate this feature in the future.

Meanwhile, here’s one interesting benefit of the Makeover Project; this embedded SQL code shows the effects of the cache. These are the top ten pages that have been cached; ‘Entry Number’ shows the LGF post number (zero is the front page), ‘Hits’ is how many times the cached version has been loaded, and ‘Misses’ is how many times the cached version expired and had to be regenerated.

(I know. It’s all very, very geeky, isn’t it. But the point is to improve our ability to stay online through the big surges.)

entry number hits misses
  0   88,009   423
  24,853   23,361   139
  24,760   6,779   307
  24,855   2,184   105
  24,840   2,163   159
  24,845   1,764   135
  24,856   1,063   94
  24,841   986   135
  24,146   945   210
  24,838   811   122

UPDATE at 3/17/07 6:23:02 pm:

And of course, this wouldn't be LGF if we didn't have the ability to turn off the caching when it isn't necessary. Since weekend traffic is usually manageable, we're now operating in real time.

Advertisement

159 comments

^ back to top ^

Name:

Pass:

Register Forgot Your Password? Re-send Confirmation (To log in, cookies must be enabled in your browser!)

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

Helping moonbats sleep soundly.

TwitterFacebook
LGF Pages
Recent Pages

Daniel Ballard
Late Afternoon Light-Kalanchoe
2 hours, 33 minutes ago
Views: 49 • Comments: 0
Tweets: 0 • Rating: 2

MikeySDCA
Colin Powell Endorsed Same-Sex Marriage Once It Was Safe, More Evidence He's Hardly a Great Leader.
2 hours, 37 minutes ago
Views: 42 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Attachment Birthers
2 hours, 46 minutes ago
Views: 50 • Comments: 0
Tweets: 0 • Rating: 0

Eclectic Infidel
City College of San Francisco Budget Update
3 hours, 25 minutes ago
Views: 66 • Comments: 0
Tweets: 0 • Rating: 0

Michael McBacon
Kansas governor signs 'Shariah bill' to ban Islamic law
7 hours, 56 minutes ago
Views: 167 • Comments: 6
Tweets: 0 • Rating: 4

Aigle
National Geographic Traveler Veers Off Track
1 day, 8 hours ago
Views: 402 • Comments: 5
Tweets: 0 • Rating: -4

MichaelJ
Apple TV Slated to Debut in December?
1 day, 9 hours ago
Views: 202 • Comments: 0
Tweets: 0 • Rating: 1

Ascher
Israeli Who Saved Turk on Everest: You Never Abandon a Friend - Israel News, Ynetnews
1 day, 10 hours ago
Views: 266 • Comments: 1
Tweets: 0 • Rating: 3

Haywood Jabloeme
The Harrassment of Patterico & Its Roots in Left-Wing Activism
1 day, 10 hours ago
Views: 482 • Comments: 2
Tweets: 0 • Rating: 4

Curt
Brian Banks: (Video) Falsely accused of rape speaks out
1 day, 12 hours ago
Views: 243 • Comments: 1
Tweets: 0 • Rating: 3

 Frank says:

I think "when" is a very important thing, but "what the f*ck!" is also a very important thing to ask. Just keep asking "what the f*ck?" I mean, why the f*ck bother? See what i mean? The important thing is, deal with the "when". "When" will open a lot of shit for you. "What the f*ck" really makes it easier to deal with it when you understand the "when".