KBD

Keith Devens .com

Monday, December 1, 2008 Flag waving
The function of wisdom is to discriminate between good and evil. – Cicero
← New Archive URLsJudy dynamic arrays in Perl 6? →

Daily link icon Sunday, March 23, 2003

Caching with Smarty

As soon as Smarty 2.5 is released, I want to check out its caching. At first, after reading that page, I was worried that I wouldn't be able to use its caching because it seemed that each cache is specific to the template file. The problem is that my CMS uses the same root template for all of my pages, so that's no good.

However, it turns out that you can use a cache_id to control caching.

It looks like I'll even be able to control the cache lifetime per URL, which is awesome. So I can set a value in my global configuration file to determine how long each URL is cached. I'll be able to specify it in as fine-grained a manner as I want. For instance, cache my yearly and monthly archives for a day, and maybe my weblog home page for only 10 minutes. Awesome.

If I really want to get anal, I could change the level of caching based on how old an entry is. So I could cache entries that are weeks old for a few days, but entries that are only a few hours old for only a few minutes since they might change.

My CMS rules Smiley

← New Archive URLsJudy dynamic arrays in Perl 6? →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

December 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

new⇒Free image hosting sites

Well, TinyPic has this in its​FAQ:

> Images and videos is in​your accoun...

Keith: Dec 1, 1:13am

Join a NameValueCollection into a querystring in C#

Well with a lamba expression, this​is what I came up​with:

?!code:csharp...

Gustaf Lindqvist: Nov 30, 4:38pm

Why no generic OrderedDictionary?

Check​http://www.codeproject.com/KB/recip​es/GenericOrderedDictionary.aspx?d...

Gabrielk: Nov 27, 6:57am

WhatIsMyIP.com

http://www.thesysteminfo.com is​another good alternate to​whatismp.com... I...

Kripz: Nov 26, 8:51pm

Girls, please don't get breast implants

Actually I think it's sweet when a​man loves a woman whether she's big​or n...

218.186.12.228: Nov 26, 9:40am

Generated in about 0.206s.

(Used 8 db queries)

mobile phone