Class: QgsConfigCache

class qgis.server.QgsConfigCache

Bases: PyQt5.QtCore.QObject

Cache for server configuration.

New in version 2.8:

Methods

instance

Returns the current instance.

project

If the project is not cached yet, then the project is read from the path.

removeEntry

Removes an entry from cache.

instance() QgsConfigCache

Returns the current instance.

Return type

QgsConfigCache

project(self, path: str, settings: QgsServerSettings = None) QgsProject

If the project is not cached yet, then the project is read from the path. If the project is not available, then None is returned. If the project contains any bad layer it is considered unavailable unless the server configuration variable QGIS_SERVER_IGNORE_BAD_LAYERS passed in the optional settings argument is set to True (the default value is False).

Parameters
  • path (str) – the filename of the QGIS project

  • settings (QgsServerSettings = None) – QGIS server settings

Return type

QgsProject

Returns

the project or None if an error happened

New in version 3.0.

removeEntry(self, path: str)

Removes an entry from cache.

Parameters

path (str) – The path of the project