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!
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