Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


SimpleCache

edited October 2007 in Questions
This discussion is related to the SimpleCache addon.
SimpleCache

Comments

  • Uploaded version 0.0.1 of SimpleCache.
  • Has any one tried this yet? Your thoughts please?
  • I think it's great. (pfff) The most important thing is to cache the good pages. An example. SC can be told to cache pages for guests only. This could be a bargain for big public forums since there is one file for all the different guests. When authenticated, you'll be served your files. Another one. It could be interesting to cache index.php and categories.php even for authenticated people, with quite long expiration times (like 5mn) since they are quite db intensive, and there is no urge to see the updates. Caching comments.php for authenticated people is quite annoying since they won't see their own posts immediatly. Now I'm planning invalidation if POST data is submitted (WallPhone again).
  • Uploaded version 0.0.2 of SimpleCache.
  • Just deleted a sentence in the readme.txt that made a reference to the beginnings of the TimeKeeper extension (that was presiously part of SimpleCache). Whether SC is installed normally or the hacky way, time is taken from the same reference now.
  • Grahack, this extension has been a great help to my site. I've done a lot of very custom extensions on Vanilla and was starting to get very slow page loads. This did the trick for unauthenticated users--thanks!

    Given it's a 0.0.2 release, do you have further plans for developing the extension? What additions did you have in mind?
  • * a manual button that administrators can click to empty the cache * some work on the header sent for the browsers to cache the page for the same duration than we cache it on the server * make other things "page dependant" like expiration time is: closing tag, display expiration time, maybe some other things yet unknown * clever invalidation and if you have other ideas...
  • Those sound great.

    Anything that allows for 'object-level' caching of elements of a page would be very welcome if it were as easy as the role-based configuration that already exists.

    It would great if I could just specify an object in the config file and then specify how long it's supposed to be cached.

    I'm not familiar enough with Vanilla's order of execution to know if that's viable, but thought I'd throw the idea out there anyway...
  • What do you mean 'object level'? Like caching just the source echoed by an extension, or a page control object like $Head, $Panel...
  • I started to use Simplecache, and was wondering if somethings can be explained--- what exactly is it caching? and does the add-on work right out of the box?

    If someone posts to a discussion, and my cache is set for 10 mins, does that mean it will be 10 mins until I see the updated discussion? This is how I assume a cache to work, but it doesn't appear to be behaving like that... I might be looking at things wrong.

    Also how do you make it cache for both authenticated users and guests?
  • It is caching the entire generated page. It mostly works out of the box, but by tweaking the configuration you can better tune it to your needs.

    I believe a new comment will invalidate the existing cache, so it would be rebuilt on the next page load. It already caches for both authenticated and guests, since each may see a very different page.
  • Just follow the readme!
    Basically you'll just have to rename the settings_demo.php file to settings.php.
    And no, sorry Wanderer, It is 'simple' because cache invalidation is only temporal. A cache file will
    continue to be served until it expires, no matter if the data displayed is obsolete
    .
    But yes, there are different files for different users, and one file for every guest (and different files for different requests of course).
  • wow, this is an excellent idea!
  • This should be updated to immediately invalidate a discussion's cache file when the user makes a post. This is the biggest usability problem, otherwise this is great.
  • Thanks for your interest ggaudrea. Problem is, there are other pages to invalidate: the home page (discussion moved at the top, comments count, last user...), the category one. I thought about this once, deeply, and couldn't arrive to something easy. If you have ideas (and implementations), I'd be happy to grab them.
  • Any chance that this can be ported to Vanilla 2?

  • x00x00 MVP
    edited February 2012

    There is a choice of built in caching support, but it may not all be fully functional, dirty, file, and mem.

    Server level caching like micro caching on nginx

    grep is your friend.

  • AnonymooseAnonymoose ✭✭
    edited February 2012

    How does one turn this on in Vanilla 2?

    Server level caching is always on here, but it works best is when the application does some caching itself to save on calls to the database and so serves what are basically static pages whenever possible. A good implementation of this is mediawiki.

  • x00x00 MVP
    edited February 2012
    $Configuration['Cache']['Enabled']  = TRUE;
    $Configuration['Cache']['Method']   = 'dirtycache'; //dirtycache,filecache,memcache
    $Configuration['Cache']['Filecache']['Store']   = PATH_LOCAL_CACHE.'/Filecache';
    

    Dirty cache doesn't do anything.

    Note there is current a bug with file cache where it will break if php is in safemode. This is not to do with caching itself, but the file manager calling is_dir on folder that it doesn't have permission to check. This can be solve quite easily with a patch since, there is no need to recursively create folders, since php 5. I have made an issue on github.

    I can't speak on effectiveness of the implementation, thought I have used the file cache independently quite effectively as pseudo transactional lock

    grep is your friend.

  • x00x00 MVP
    edited February 2012

    Btw file cache the workaround would be to change

    $Configuration['Cache']['Filecache']['Store'] = PATH_LOCAL_CACHE.'/Filecache';
    

    to something like

    $Configuration['Cache']['Filecache']['Store'] = './cache/Filecache';
    

    not ideal but most server should have ./ set correctly.

    If it working then you should see folder in cache/Filecache

    grep is your friend.

  • AnonymooseAnonymoose ✭✭
    edited February 2012

    Thanks! Very nice. I'll try this.

Sign In or Register to comment.