This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
unknown (author)
Fri May 08 21:30:48 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
README | Fri May 08 21:30:48 -0700 2009 | |
| |
extras/ | Fri May 08 21:26:12 -0700 2009 | |
| |
tests/ | Fri May 08 21:26:12 -0700 2009 | |
| |
views/ | Fri May 08 21:30:48 -0700 2009 |
README
/* * HtmlCache Plugin * Copyright (c) 2009 Matt Curry * http://pseudocoder.com * http://github.com/mcurry/html_cache * * @author mattc <matt@pseudocoder.com> * @license MIT * */ /* About */ Cake's core cache helper is great, but the files it outputs are PHP files, so it will never be as fast as straight HTML files. This HTML Cache Helper writes out pure HTML, meaning the web server doesn't have to touch PHP when a request is made. This plugin is for sites with high traffic pages that have nothing unique about the user on the page. I use this helper on http://www.rsstalker.com. It handles the custom RSS feeds (currently around 13k), which is perfect since there is nothing user specific in the XML. Each feed gets hit multiple times a day, by multiple aggregators. This really adds up to a ton of requests. /* Notes */ * Nothing specific to a user on the page. No "Welcome, Matt" or shopping carts. * Cache will never expire. See below for workaround. /* Instructions */ * Include the helper in your controller: $helpers = array('HtmlCache.HtmlCache'); * Or in a single action $this->helpers[] = 'HtmlCache.HtmlCache'; * Update your webroot .htaccess file to include the following lines before CakePHP's Rewrite Cond (see webroot.htaccess for an example): RewriteCond %{DOCUMENT_ROOT}/cache/$1/index.html -f RewriteRule ^(.*)$ /cache/$1/index.html [L] /* Tips */ * To expire the cache I use a cron job which deletes old files from the directory. find /full/path/to/app/webroot/cache -mmin +360 | xargs rm -f * A sample htaccess file, cache.htaccess is included that will additionally gzip the cached files for even better performance.







