Cache
From Joomla! Documentation
This article is tagged because it NEEDS REVIEW. You can help the Joomla! Documentation Wiki by contributing to it.
More pages that need help similar to this one are here. NOTE-If you feel the need is satistified, please remove this notice.
- Joomla heeft verschillende manieren om "dingen" te cachen. Hier is een overzicht voor administrators en ontwikkelaars voor wat, waar en wanneer.
Voor beheerders
Een Joomla! beheerder kan gebruik maken van de volgende caches en opties:
Pagina caching
- Configuratie: Ingebouwde plugin (Extensies -> Plugins -> System - Cache)
- Caches: elke pagina van uw website
- Gebaseerd op: URL
- Meer informatie:
- Optionele browser caching: Cached ook op de browser/computer van je bezoeker
- Alleen pagina caches voor gasten (niet voor ingelogde bezoekers)
View caching
- Configuration: Global Config->Cache
- Caches: each view of a component
- Based on: URL, view, parameters, ...
- More info: Component developers have to include this in their code to work. Mostly this is not done. The Joomla main content component uses this, but only for guest visitors of your site though this is not obligated for every component.
Module Caching
- Configuratie"': Global Config->Cache
- Caches"': elke module (individueel aangepast via elke module's Geavanceerde Parameters)
- Gebaseerd op: ?
- Meer info: Je moet het uitschakelen op sommige modules om problemen te voorkomen
Verder Caching
Als u wilt om te controleren andere cache systemen en mogelijkheden, je dient de cache instellingen in extensies van derden te controleren
Caching engines or storages
- Configuration: Global Config->Cache
Here you can choose which system you want your site to use for all caching. Current options are: APC, Eaccelorator, File, Memcache, Redis, XCache.
APC, bijvoorbeeld, slaat ook uw php opcode (operationele code) op.
For Developers
The class JCache allows a lot of different sorts and levels of caching. The following sub-classes are made specifically, but you can add your own, or use the main one in many different ways.
Don't forget that the first level of cache encountered, will override any deeper caching. I suppose that too many levels is also counterproductive (to be verified though).
- JCacheView caches and returns the output of a given view (in MVC). A cache id is automatically generated from the URI, specific view and its specific method, or you can give your own.
This can automatically be done via the base controller's display function. For example in the controller of your component:
class DeliciousController extends JController {
function display() {
parent::display(true); //true asks for caching.
}
}
There are also some urlparams to consider. Check this "joomla stack"
Also, be aware that any updates (such as hits or visit counts) will NOT be updated (unless you add this outside this method and thus any deeper MVC-part.)
- JCachePage caches and returns the body of the page.
- JCacheCallback caches and returns the output and results of functions or methods.
If you want to cache queries, this is a good class for it, as illustrated here: Using caching to speed up your code
- JCacheOutput caches and returns output.
This is rather meant for caching a specific part of php code. It acts like an output buffer, but cached. <headertabs/>