Difference between revisions of "Cache/fr"

From Joomla! Documentation

(Created page with "==Cache de page== *'''Configuration''' : plugin intégré (Extensions -> Gestion des plug-ins -> Système - Cache de page) *'''Caches''' : chaque page de votre site *'''Basé...")
(Created page with "==Cache de vue==")
Line 13: Line 13:
 
**Uniquement les caches de pages pour les invités (pas pour les utilisateurs enregistrés).
 
**Uniquement les caches de pages pour les invités (pas pour les utilisateurs enregistrés).
  
==View Caching==
+
==Cache de vue==
 
*'''Configuration''': Global Config->Cache
 
*'''Configuration''': Global Config->Cache
 
*'''Caches''': each view of a component
 
*'''Caches''': each view of a component

Revision as of 17:21, 27 May 2015

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎eesti • ‎español • ‎français • ‎italiano • ‎português • ‎русский • ‎فارسی • ‎हिन्दी • ‎中文(台灣)‎
Copyedit.png
This Article Needs Your Help

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! propose différentes options de "mise en cache". Voici un aperçu destiné aux administrateurs et développeurs du quoi, où et quand...

Pour les administrateurs

Un administrateur Joomla! pourra utiliser les options et caches suivants :

Cache de page

  • Configuration : plugin intégré (Extensions -> Gestion des plug-ins -> Système - Cache de page)
  • Caches : chaque page de votre site
  • Basé sur : l'URL
  • Plus d'infos :
    • Option mise en cache du navigateur : également, les caches de en fonction du navigateur/ordinateur de vos visiteurs.
    • Uniquement les caches de pages pour les invités (pas pour les utilisateurs enregistrés).

Cache de vue

  • 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

  • Configuration: Global Config->Cache
  • Caches: each module (individually customized via each module's Advanced Parameters)
  • Based on: ?
  • More info: You must disable it on some modules to avoid problems

Further Caching

If you want to check out other cache systems and possibilities, you might want to check out the third-party extensions around caching.

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, XCache.

APC, for example, also caches your php opcode.

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/>

Références