Using the cache

Using the cache

Information on cache usage is available in Configuration / General / System).

9.2

9.2.1

If one of the APCu or WinCache cache systems is present on the server, it will be automatically used by GLPI. The system is based on Symfony Cache.

The cache makes it possible to improve performance on certain relatively heavy operations, such as loading translations, or calculating entity trees.

There are two distinct caches in GLPI:

  • The database cache

  • The translations cache

This distinction makes it possible to avoid storing the translation cache on a network, which could produce too many requests on the network and ultimately have a negative impact.

Conversely, the database cache should be on the network in case of multiple front-ends.

In order to allow you to refine the settings, or to use another cache system, a manual solution is proposed. To take advantage of it, add to the glpi_configs table a cache_db and/or cache_trans key for the core context and adapt the value according to what you want.

If the goal is to disable either of these caches, create the key in the table, but leave the value blank.

{"adapter":"apcu"}
{"adapter":"redis","options":{"server":{"host":"127.0.0.1"}}}

Refer to the Config::getCache() method and Symfony Cache documentation for more information.

OPCache

OPCache stores pre-compiled PHP files in memory, which improves performance. The only thing to do is to install it on your PHP instance and configure it (the default configuration should be fine in the vast majority of cases).

However, on instances that could be heavily used, it may be useful not to include font files for PDFs in this cache. Indeed, they take up a lot of space, and the gain is relatively minimal.

In order to exclude the font files from the cache, all you have to do is enter their full path in a blacklist file for opcache. The path to this file is determined by the configuration diective opcache.blacklist_filename ( /etc/php.d/opcache-glpi.blacklist for example under Fedora). If your GLPI instance is in the folder /var/www/, the path to exclude will be /var/www/html/glpi/glpi-9.2.1/vendor/tecnickcom/tcpdf/fonts/.

Of course, the location of the configuration file and the path to the fonts should be adapted according to your system and your type of installation.

Last updated

Was this helpful?