Textpattern Forum

You are not logged in. Register | Login | Help

#61 2012-02-16 09:03:46

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

Re: aks_cache: Partial caching web pages. SpeedUp your site!

maniqui wrote:

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(); 
              }
         }

simplify patch:

         if($Status >= 4 or $oldArticle['Status'] >= 4) {
              if ($oldArticle['Status'] < 4) {
                  do_pings();
              }
              update_lastmod();
          }

or add expires condition

         if( ($Status >= 4 or $oldArticle['Status'] >= 4)and (!$expires or $expires>=time()) ) {
              if ($oldArticle['Status'] < 4) {
                  do_pings();
              }
              update_lastmod();
          }

aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

#62 2012-02-16 09:22:03

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

Re: aks_cache: Partial caching web pages. SpeedUp your site!

Gocom wrote:

I wouldn’t recommend modifying core.
[skip]
Which can be loaded via a modular plugin content (plugin, theme etc).

Maybe it’s time to develop plugin such as abc_fixup-know-txp-core-bug ? ;-)

IMHO, it’s a core bug.
Switching an article’s status from “live” to “hidden” or “draft” – equivalent to the removal of articles from the frontend.
Removal of articles and references to it is a modification of content and should be reflected in the field lastmod.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

#63 2012-02-16 14:42:08

Gocom
Developer
Registered: 2006-07-14
Posts: 4,465
Website

Re: aks_cache: Partial caching web pages. SpeedUp your site!

makss wrote:

IMHO, it’s a core bug.

Yes, didn’t say otherwise. Particularly whole update and caching model is lacking of features. Serves very little purpose of any site that get stream of new content. Things you get from having an open model.


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#64 2012-07-05 06:00:05

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,091
Website

Re: aks_cache: Partial caching web pages. SpeedUp your site!

makss wrote:

IMHO, it’s a core bug.

Fixed in r3913.

I dismissed the $expired part because it didn’t play well with expired dates from the past.

Offline

#65 2012-07-21 16:40:13

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,050
Website

Re: aks_cache: Partial caching web pages. SpeedUp your site!

Using this plugin here… phtww.com and it really helps with page load times.

The main nav, pretty much cycles through every article on the site, so caching that part is really powerful.

I’ve been using the following approach for article forms.

<txp:aks_cache id='this-form-<txp:section/>-<txp:article_id/>'>Form Contents</txp:aks_cache>

This produces about 30 cached items.

Q: Is this too much? Ie are the benefits of caching going to decrease as I have more items cached?

Offline

#66 2012-10-30 22:51:05

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 739

Re: aks_cache: Partial caching web pages. SpeedUp your site!

I’m using etc_query to grab a feed from Instagram via their API. Works great. But often there are funky characters in photo captions. When I cache a block of content with aks_cache these characters cause the page to cease loading the html — when viewing source, the html stops where there is one of these (probably) invalid characters (represented as a square when I import it ‘live’).

I have tried cleaning the initial import without success; any suggestions from the cache side of things? or is it essentially a problem with the import?

Offline

#67 2013-02-01 12:53:14

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 165

Re: aks_cache: Partial caching web pages. SpeedUp your site!

@makss

I wonder if it would be possible to integrate disk caching or more concrete: mem caching, to reduce the mysql load, because if you have several small pieces of a page in cache, for every piece you have to make a mysql query and that could possible slow down the site rendering, if your site has several parallel requests.
For example:
On a typical artical page, I have eight different aks_cache blocks and about 7000 entries in aks_cache. That means eight mysql queries per page.
The debug shows, that for page rendering 79 queries (maybe too much stuff) are made, so with disk/mem caching I could save these eight requests.
<!-- Runtime: 0,1350 --><!-- Query time: 0,020996 --><!-- Queries: 79 --><!-- Memory: 6585Kb
Ok, maybe it sounds not worth it, but anyway if you have not two request a second, but five or more it could be a relevant speed factor. I mean for huge sites on textpattern not small blogs or something :-).

So as an alternative you could consider to offer as an option disk caching in memory, for example in /dev/shm/textpattern_cache or so …

In principle the good old zem_cache could fulfil this function, but I’m not sure if it is still working and it seems to me, that aks_cache is more flexible in use.
A problem is, that AFAIK only root users have rights to use /dev/shm on hosting plattforms, so standard directory for caching could be /textpattern/tmp, but then you depend not on memory speed, but on disk speed. Anyway I think disk/memory caching could speed up some sites.

Offline

#68 2013-02-19 09:09:05

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

Re: aks_cache: Partial caching web pages. SpeedUp your site!

For busy sites and full page caching is ready solutions written in C, I would recommend using nginx with its wonderful cache

WEB users ==>  nginx(with cache manager)  ==> apache ==> Txp ==> MySQL

or

WEB users ==>  nginx(with cache manager)  ==> php-fpm ==> Txp ==> MySQL

On a typical artical page, I have eight different aks_cache blocks and about 7000 entries in aks_cache

A small note: the file system will be difficult to store over 2000-3000 files in one directory, so you need to provide for sharing of files into multiple directories.

There is a plugin rah_cache

One idea to reduce the load on MySQL.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

Board footer

Powered by FluxBB