Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Okay Julian…
Related: did you experience some hickups with this plugin. Sometimes I suspect the cache is either not flushed or is not rebuilt properly…
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Do you have any theory for your suspicions?
Not that I can recall but… now that you mention, something similar (cache not being flushed/rebuilt properly) happened to me, but the culprit was not the plugin.
This is what I was perceiving: right after hitting the “reset cache” (or “clear all cache”) button, the aks_cache tab reloaded, and there were a few cache “leftovers”. How could that be possible if I just cleared the cache and didn’t visit the front-end, so it couldn’t be generating a new cache?
Checking the Network tab on Web Inspector show me the light: after hitting the “reset cache” (or “clear all cache”) button, the admin page gets reloaded. I noticed, in the Network tab, that a few images used in admin source (the carver and others) were missing, thus, when requested, they generated a 404 in TXP. That 404 page, managed by TXP, also included some aks_cache code (for caching widgets). So, what I perceived as “leftovers” were, in reality, new cache chunks generated right instantly after I cleared the cache.
May something similar be happening to you?
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
I’m not sure if this is the cause…
Since I know you’ve investigated a lot on this plugin I wanted to make sure you didn’t cross this behaviour as well…
I’ll keep your answer in mind so I can reference it if I cross this problem again…
Thanks !
Last edited by hablablow (2011-12-01 19:59:55)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
#49 2012-01-23 21:56:19
- makss
- Plugin Author
- From: Ukraine
- Registered: 2008-10-21
- Posts: 355
Re: aks_cache: Partial caching web pages. SpeedUp your site!
New version aks_cache 0.2.8
Changes:
- Added attribute
form
Example:
<txp:aks_cache id="block1" form="my_txp_form" />
Last edited by makss (2016-01-16 18:55:04)
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!
Makss,
When I change the status of an article, from live to hidden for example, the cache doesn’t get flushed ?
Is this article status change not considered as a site upadate in your plugin ?
Thanks.
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Guillaume,
it’s not that the plugin doesn’t consider the status change as an update, as, in that sense, the plugin really doesn’t “know” anything about TXP contents.
The plugin just looks at the value of lastmod field, and then, it does its magic.
The “problem” is that switching an article’s status from “live” to “hidden” doesn’t update the value of lastmod field.
Workaround for this would need hacking the article_save function just a little.
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
I see Juan.
Will digg the subject.
Gracias +
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Guillaume,
you could try this (not tested).
Replace lines 312-317 with:
if($Status >= 4) {
if ($oldArticle['Status'] < 4) {
do_pings();
}
update_lastmod();
} else {
//New status is less than 4 (that is, it's not "live" nor "sticky")
// Check if status for "old" article was "live" or "sticky"
if ($oldArticle['Status'] >= 4) {
// If so, update lastmod
update_lastmod();
}
}
PS: Juan? Quién es Juan?
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Barbaro !
Rollas + gracias.
Y perdon para tu nombre Julián !
Last edited by hablablow (2012-02-14 11:00:21)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
I wouldn’t recommend modifying core. I would just simply hook update_lastmod() function to article, save event. All that should technically be just a single line of code. E.g.
register_callback('update_lastmod', 'article', 'save');
Which can be loaded via a modular plugin content (plugin, theme etc). Not tested, but should work just fine.
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
Good to know, Gocom.
It’s not the first time that I suggest solving something by hacking the core, and then, you come to suggest not to do so, while also providing a better solution :)
I’ll test adding that line at the top of aks_header (meh, hacking a plugin this time), to see if it works as advertised.
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
And I’ll do the same…
Thank you for your answers folks.
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
I tried it, but didn’t work for me. I added the line as this (and also tried outside the if statement).
if(@txpinterface == 'admin') {
add_privs('aks_cache_tab', '1,2');
register_tab("extensions", "aks_cache_tab", "aks_cache");
register_callback("aks_cache_tab", "aks_cache_tab");
add_privs('plugin_prefs.aks_cache','1,2');
register_callback('aks_cache_tab', 'plugin_prefs.aks_cache');
// Here:
register_callback('update_lastmod', 'article', 'save');
}
After hitting the save button on an article, the value for lastmod field doesn’t get updated. Am I do it wrong?
Last edited by maniqui (2012-02-14 14:58:50)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
maniqui wrote:
After hitting the save button on an article, the value for lastmod field doesn’t get updated. Am I do it wrong?
Ugh. Yeah, my bad. The step isn’t named save, but edit prior the editor panel. The pane step (for some obscure reason) is modified on the fly middle of the panel. So, hooking to the callback event executed after the panel should work. E.g.
register_callback('update_lastmod', 'article', 'save', 0);
That should do it. Probably. Most likely. Who am I to lie. I tested it. It works *wink*.
Last edited by Gocom (2012-02-14 14:50:46)
Offline
Re: aks_cache: Partial caching web pages. SpeedUp your site!
:)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline