Index: openacs-4/packages/acs-core-docs/www/tutorial-caching.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-caching.html,v diff -u -r1.11.2.3 -r1.11.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-caching.html 19 Nov 2016 09:21:55 -0000 1.11.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-caching.html 6 Jan 2017 09:18:42 -0000 1.11.2.4 @@ -8,4 +8,4 @@ return [util_memoize [list my_proc_not_cached -foo $foo]] }
  • In your code, always call my_proc. There will be a seperate cache item for each unique call to my_proc_not_cached so that calls with different arguments are cached seperately. You can flush the cache for each cache key by calling util_memoize_flush my_proc_not_cached args.

  • The cached material will of course become obsolete over time. There are two ways to handle this.

  • If you are correctly flushing the cached value, then it will need to be reloaded. You may wish to pre-load it, so that the loading delay does not impact users. If you have a sequence of pages, you could call the cached proc in advance, to increase the chances that it's loaded and current when the user reaches it. Or, you can call (and discard) it immediately after flushing it.

  • + Direct Flushing. In any proc which invalidates the cached content, call util_memoize_flush my_proc_not_cached args.

  • If you are correctly flushing the cached value, then it will need to be reloaded. You may wish to pre-load it, so that the loading delay does not impact users. If you have a sequence of pages, you could call the cached proc in advance, to increase the chances that it's loaded and current when the user reaches it. Or, you can call (and discard) it immediately after flushing it.