Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2012-01-23 21:56:19

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

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

#50 2012-02-13 19:01:28

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

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__

Hablablow + Webdesignofficina

Offline

#51 2012-02-13 19:52:13

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#52 2012-02-13 21:54:23

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

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__

Hablablow + Webdesignofficina

Offline

#53 2012-02-14 00:58:48

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#54 2012-02-14 10:59:29

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

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__

Hablablow + Webdesignofficina

Offline

#55 2012-02-14 11:59:14

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#56 2012-02-14 13:29:33

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#57 2012-02-14 13:38:43

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

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__

Hablablow + Webdesignofficina

Offline

#58 2012-02-14 14:08:00

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#59 2012-02-14 14:47:07

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#60 2012-02-14 15:07:17

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

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__

Hablablow + Webdesignofficina

Offline

Board footer

Powered by FluxBB