-
Notifications
You must be signed in to change notification settings - Fork 42
Custom cache
Ben Peachey edited this page May 4, 2025
·
1 revision
This page contains design of future improvements to caching. Only basic syntax works in current releases.
Current syntax is:
phptal:cache="<time> per url"
or
phptal:cache="<time> per <expresssion>"
Where <time> is 1m, 1h, 1d, etc.
You can easily cache per URL and another variable (this requires definition of temporary variable and/or getting current URL passed to the template).
It could be solved by using
phptal:cache='<time>;? per <url|expresssion> [; per <url|expression>]* '
e.g.
phptal:cache='1h; per url; per user/id'
PHPTAL needs cache "plugins" to be able to use APC, memcached and other caching mechanisms.
What should be interface of this class?
What information plugins need? Should they parse phptal:cache expression or only parsed and processed data?