【技巧】404 Funky Caching



贊助商連結


namie2000
2005-04-23, 10:19 PM
這是一種用在大量抓同一個 php page 時所使用的 cache 技巧…

Funky caching explained (http://simon.incutio.com/archive/2002/11/16/funkyCachingExplained) (from Simon Willison’s Weblog (http://simon.incutio.com/))
Half-baked, and a little fried (http://philringnalda.com/blog/2002/11/halfbaked_and_a_little_fried.php) (from phil ringnalda dot com (http://philringnalda.com/))
Baking, funky caching, and tarballs for weblog cryo storage (http://www.decafbad.com/blog/2002/11/28/ooocch) (from 0xDECAFBAD (http://www.decafbad.com/))

最原始在 PHPCon 發表的文件:
Rasmus Lerdorf’s PHP Tips and Tricks (http://www.lerdorf.com/tips.pdf) (pdf)

作法其實很簡單:把 404 handler 指到一個 .php,由這個 .php 生 static page 出來,下次 http server 就不會再 call 404 handler (因為檔案存在了)。