aks_cache
Partial caching web pages in Textpattern
Summary
Caching all inside <txp:aks_cache id="unique block id"> Any content with TxP tags </txp:aks_cache>
Good practice:
- Cache some menu elements; recent articles list; last added articles list; any popular lists.
- Cache
cloudtags - Cache site
main pageor cache some ‘slow’ pages with many TXP tags. - Cache output some slow or difficult tags.
Bad practice:
- Cache static content without TxP(or php include) tags
- Full cache every page
- Cache static
bodyevery page
Installation
- Install this plugin.
- Go to Extension / aks_cache Tab
Admin interface

Changelog
v0.2
First public release
v0.2.1
Extend admin tab
v0.2.3
Added option: “Reset cache if site was updated”
v0.2.4
Added option: “Disable cache for admin”
v0.2.5
Added attribute block
v0.2.6
Added attribute disable
Added tag <txp:aks_cache_disable />
v0.2.7
Added option: “Disable cache for users”
v0.2.8
Added attribute form
Tags
<txp:aks_cache> – Uses in page templates, forms, articles.
| attributes | default | sample | description |
|---|---|---|---|
| id | ["REQUEST_URI"] |
‘’ | Unique ID for each cache block |
| block | ‘’ | ‘’ | for using without id attribute |
| hour | 0 | ‘’ | Cache time = hour*60+min |
| min | 0 | ‘’ | —//— |
| noreset | 0 | 1 | No reset cache for this block – ignore option “Reset cache if site was updated” |
| disable | 0 | 1 | Disable cache |
| form | ‘’ | 'my_form' |
Used in single tag. Caching TxP form |
| debug | 0 | 1 | 0 or 1 |
<txp:aks_cache_disable /> – Used ONLY inside <txp:aks_cache> … </txp:aks_cache> block.
Example
<txp:aks_cache id="block1">Some content and txp tags...</txp:aks_cache>
<txp:aks_cache id="block1" form="my_txp_form" />
Cache menu elements per section
<txp:aks_cache id='menu <txp:section />'> <h3>Tags cloud</h3> <rss_uc_cloud section='<txp:section />' /> <h3>Last added articles</h3> <txp:article_custom form="tf_excerpt" limit="20" section='<txp:section />' sort="LastMod desc" /> </txp:aks_cache>
Successful story
Site1 TxP 4.2.0
main page before install aks_cache:
<!-- Runtime: 1,3107 --><!-- Query time: 0,890924 --><!-- Queries: 20 --><!-- Memory: 5336Kb, -->
after:
<!-- Runtime: 0,0513 --><!-- Query time: 0,014651 --><!-- Queries: 14 --><!-- Memory: 2956Kb, -->
article page before:
<!-- Runtime: 0,8311 --><!-- Query time: 0,678711 --><!-- Queries: 30 --><!-- Memory: 3004Kb, -->
after:
<!-- Runtime: 0,1720 --><!-- Query time: 0,091886 --><!-- Queries: 27 --><!-- Memory: 3019Kb, -->
Graph from Google webmaster tools

aks_cache plugin was installed 09 april 2010, now 26 april 2010