1
Eastgrove
About caching...
  • 2006/12/8 6:44

  • Eastgrove

  • Just popping in

  • Posts: 5

  • Since: 2002/5/15


Hi there!

I'm putting up a couple of sites that hopefully will get a lot of visitors. In order to make the site more friendly on my cpu-usage i want to enable caching.

I know that you can have longer times between cache updates on pages/modules that get new content less frequently and really shouldn't have caching enabled on, for example, the forum.

Is there a good reason why the caching couldn't be dynamic? By that i mean let the caching be permanent, i.e. cache once, no updates. And then update the cache when new content is added.

That way its only updated when needed and it would perhaps work with the forums as well? Perhaps the forums threads could be cached separately and updated when there's a new post.

Can this be enabled easily? Hmm.. otherwise this thread perhaps should be placed in the Feature Requests forum. Mods, feel free to move it there if its more suitable.

But what do you think about my idea of dynamic caching? Is it doable? Easy? Hard? i don't know so im asking you..

-Anders

2
irmtfan
Re: About caching...
  • 2006/12/8 7:15

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


your post is very long!
i have a short and simple answer and also its powerful
Use the Fastest Cache Hack - by Gijoe

just mentioned:
1- This hack is not for novices but for experts.
2- it Saved almost 30% of CPU and use another 100-200 Mb of HDD( related to your files)

also i can tell you its not very easy to install nor hard its a so so.

you must learn about XOOPS_TRUST_PATH

im using this hack in my site without any problem.i also can recommend this hack for any busy XOOPS sites.

@Eastgrove : I move it to "xoops core hack" forum

3
wizanda
Re: About caching...
  • 2006/12/8 8:22

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Agree on point of dynamic Cache it is something I am looking at and why the constant looking at Smarty lately....

Yet, yes as far as I know it is better to have something cached even for a little...reason being is Smarty then renders the html template....this is given an ID in your database for Smarty to find and display that template written...else each time anyone comes to the same page...it repeats the same questions of whom, where and what each time instead of just once....

Yet as soon as can figure a way out that doesn't require any hacking and XOOPS is pre-configured dynamical, the better for all of us...can't stand trying to figure what Cache is best for what....

4
Mithrandir
Re: About caching...

The idea is generally good and something I have implemented in some modules already (article module for cw.dk and OBS_Classroom, the latter is available at http://xoops.web-udvikling.dk).

The main challenge when making a generic system-wide solution is that there is practically no way that the core can know which pages are influenced by a change.

I mean - say we write a reply to a forum thead. Then the thread needs updating, the forum page needs updating and perhaps the top-level forum listing page needs updating.
Not to mention that any blocks showing the latest threads, latest posts or most active threads will also need updating.

The only one, who can actually know this, is the module developer - and even then, the blocks updating will be quite difficult.

So I'd say that module content can be cached and updated with this method, but blocks are more of a challenge, and it will not be easy to implement with core "magic" but must be implemented in the individual modules.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

5
wizanda
Re: About caching...
  • 2006/12/8 9:19

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Maybe it's just me yet doesn't Smarty says it can do this, in it's config file....that it will either check if updates are needed or not...

Smarty.Class.php
Quote:

/**
* Only used when $caching is enabled. If true, then If-Modified-Since headers
* are respected with cached content, and appropriate HTTP headers are sent.
* This way repeated hits to a cached page do not send the entire page to the
* client every time.
*
* @var boolean
*/
var $cache_modified_check = false;


what we need then, is just to make sure Smarty uses it, and have a dynamic setting for this...

6
nachenko
Re: About caching...
  • 2007/6/7 15:10

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


I have to say it somewhere.

GiJoe's Fastest Cache Hack RUNS LIKE HELL.

It's amazingly amazingly fast.

Of course is a cache, it does not notic the content has changed, but if you want speed, this is the one.

Login

Who's Online

172 user(s) are online (78 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits