Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
aks_cache: Partial caching web pages. SpeedUp your site!
Partial caching web pages
Version 0.3b download link / homepage
Summary:
Caching all inside <txp:aks_cache id="unique block id">
Any content with TxP tags </txp:aks_cache>
- Cache some menu elements; recent articles list; last added articles list; any popular lists.
- Cache
cloud
tags - Cache site
main page
or cache some ‘slow’ pages with many TXP tags. - Cache output some slow or difficult tags.
- Cache static content without TxP(or php include) tags
- Full cache every page
- Cache static
body
every page
Screenshot:
Related:
To freeze random content
Docs and Successful story
Last edited by makss (2017-03-12 13:03:13)
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Brilliant ! Thanks!
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
New version aks_cache 0.2.1
Changes:
- Extend admin interface
Last edited by makss (2016-01-16 18:51:16)
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Just tried this on my “Most Popular” and a “Top Referrers” list on my website and it seems to work like a charm! This + aks_header has made my website faster than ever so… thanks! :D
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
I use actually zem_cache and your new plugin seems to be more comfortable to use, but is it possible to distinguish between “global” cache and cache per page?
To clearify: zem_cache had a ‘ctx’ and a ‘id’ parameter
id – Use this if you’re using multiple zem_cache tags per page. Each tag should have a different id. It doesn’t matter what the id is set to – a number is fine – as long as each one is different.
ctx – Use this to cache a single copy of something globally across all pages, rather than once per page. For example, <txp:zem_cache ctx=“recent1”><txp:recent_articles /></txp:zem_cache>
thanks
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
whocarez wrote:
I use actually zem_cache and your new plugin seems to be more comfortable to use, but is it possible to distinguish between “global” cache and cache per page?
To clearify: zem_cache had a ‘ctx’ and a ‘id’ parameter
aks_cache
use one parameter id
for “global” or cache per page.
Sample cache two blocks in one page per section:
<txp:aks_cache id='<txp:section />_block1'> Content block1. </txp:aks_cache> Some... <txp:aks_cache id='<txp:section />_block2'> Content block2. </txp:aks_cache>
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
New version aks_cache 0.2.3
Changes:
- Add option: “Reset cache if site was updated”
Last edited by makss (2016-01-16 18:51:40)
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
New version aks_cache 0.2.4
Changes:
- Add option: “Disable cache for admin”
Last edited by makss (2016-01-16 18:52:01)
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
I tested aks_cache on my site and discovered, that it is only partly usable for me. Maybe I use the parameters not in the right way.
For example: I used zem_cache to cache “keywords” and “related articles” and also for “meta descriptions”. They are different for every article.
When I put aks_cache with id=“related” in the code, then there is only one cache for “related” articles and it shows these “related articles” under every article which is showed up, so it is not the intentioned use. So, if I used it in the right way, the aks_cache plugin is yet only for global caches usable.
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Although I’ve never used the plugin (I’m planning to use it on a current project), you could try something like this:
id='related-<txp:article_id />'
.
This way, you will have one cache for each article.
Please, tell us if that works. Thanks :)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Yes! It was obvious, but not for me :-) Makss explained it in the help section <txp:aks_cache id='menu <txp:section />'>
, but I overlooked it …
So I could convert all tags <txp:zem_cache ctx="xyz" />
to <txp:aks_cache id="xyz" />
and all <txp:zem_cache id="xyz" />
to <txp:aks_cache id='xyz-<txp:article_id />' />
zem_cache isn´t needed any more … Thanks Makss (дуже дякую)!
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
hi Makss,
thanks for this plugin. I’m finally trying it and I like it.
However, I’m having some issues, and I’m not yet sure if this is a plugin issue or my fault.
The first issue I encounter is that, for aks_cache blocks where the id is created by using tags-in-tags, the plugin is creating two cache blocks.
For example:
cache block_id | ttl(minutes) | size(bytes) |
noreset-last_tweets | 60 | 727 |
noreset-otf_css_news | 60 | 134 |
noreset-otf_css_ | 60 | 126 |
site_vars_news | 60 | 3 |
site_vars_ | 60 | 3 |
last_tweets
block is just a cache block created by using id="last_tweets"
.
On the other hand, otf_css
and site_vars
are blocks that are suffixed with <txp:section />
, like this.
<txp:aks_cache id='site_vars_<txp:section />'>
<txp:variable name="body_id"><txp:pax_grep from="'-'" to="_">s_<txp:section /></txp:pax_grep></txp:variable>
<txp:variable name="body_class"><txp:pax_grep from="'-'" to="_">s_<txp:section /></txp:pax_grep></txp:variable>
</txp:aks_cache>
<txp:aks_cache id='otf_css_<txp:section />' noreset="1">
<!-- On-the-fly styles for highlighting active section -->
<style type="text/css">
.<txp:variable name="body_id" /> #nav_<txp:variable name="body_id" /> a {
color:#95292c;
}
</style>
</txp:aks_cache>
As you can see, there is nothing special, just some tags-in-tags in the id
attribute.
However, as the above table shows, the cache block is created twice, one suffixed, and the other one not, and with different sizes. The difference in sizes comes from the fact the un-suffixed version is just wrong.
For example, the otf_css_news
cache block renders:
<!-- On-the-fly styles for highlighting active section -->
<style type="text/css">
.s_news #nav_s_news a {
color:#95292c;
}
</style>
While the otf_css_
(wrong, un-suffixed) version renders:
<!-- On-the-fly styles for highlighting active section -->
<style type="text/css">
.s_ #nav_s_ a {
color:#95292c;
}
</style>
In the case of site_vars_news
and site_vars_
the thing is worst, as it renders empty (as you can see, it only has 3 bytes).
May this be this a bug?
Offline