Funky Caching
   HOME

TheInfoList



OR:

Funky caching is the generation, display and storage of dynamic content when a requested static web page resource isn't available. The name is based on the idea of treating the web server, serving static pages, as a
cache Cache, caching, or caché may refer to: Places United States * Cache, Idaho, an unincorporated community * Cache, Illinois, an unincorporated community * Cache, Oklahoma, a city in Comanche County * Cache, Utah, Cache County, Utah * Cache Count ...
. However, unlike common reverse caches, the funky cache is part of the web server software, and has the ability to dynamically generate this content. It assumes that all pages are potentially generatable on-demand. If they are not, the conventional
HTTP 404 In computer network communications, the HTTP 404, 404 not found, 404, 404 error, page not found or file not found error message is a hypertext transfer protocol (HTTP) standard response code, to indicate that the browser was able to commun ...
error is returned, as usual. The overall advantage is relatively small, compared to a conventional cache. Architecturally it is also a poor design. However it does allow small sites with no separate cache layer to achieve some of the advantages of caching (albeit a little inflexibly). This is why it became popular at one time for small, single-server dynamic web sites, particularly those built within the PHP community, where the technique originated. A drawback to the technique is that it requires the web server process to have write access to the web content space. For security reasons, this is not usually required or permitted.


Origin

It is also known as the ErrorDocument trick, Smarter Caching and Rasmus' Trick, the latter name in honor of
Rasmus Lerdorf Rasmus Lerdorf (born 22 November 1968) is a Danish-Canadian programmer. He co-authored and inspired the PHP scripting language, authoring the first two versions of the language and participating in the development of later versions led by a grou ...
, creator of the
PHP PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group ...
programming language, who was allegedly the first to present this mechanism (though it is also attributed to Stig Bakken). One common usage is the replacement of the HTTP Error404 ErrorDocument with a dynamic script. Another way to look at it as a variation of the cache-aside pattern where, instead of reading the data from the data store, it is generated dynamically, and where the implementation spans an architecture (in this case the Web server and the Web app language) instead of being implemented in a single system.


References

Cache (computing) {{computing-stub