Caching
Generated solutions can be cached if the solution provider in use is cacheable (see \EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Provider\SolutionProvider::isCacheable). For this, a filesystem-based solution cache is implemented. In addition, an exception cache is provided which stores exceptions when solution streaming is active.
Note
All caches are low-level caches and cannot be configured.
- class ExceptionsCache
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Cache\ Exceptions Cache
Low-level cache manager for exceptions. This class is only used in combination with solution streaming.
Note
This cache writes to
var/
.cache/ data/ tx_ solver/ exceptions. php - get ( $entryIdentifier)
-
Get exception by cache identifier. If no cache with the given identifier exists,
null
is returned.- param string $entryIdentifier
-
Cache identifier of the exception to look up
- returntype
-
Throwable|null
- getIdentifier ( $exception)
-
Get calculated exception identifier of the given exception.
- param Throwable $exception
-
Exception to calculate a cache identifier
- returntype
-
string
- class SolutionsCache
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Cache\ Solutions Cache
Low-level cache manager for solutions. This class is used in combination with \EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Provider\CacheSolutionProvider.
Note
This cache writes to
var/
.cache/ data/ tx_ solver/ solutions. php - get ( $problem)
-
Get cached solution for the given problem. If no solution exists in cache,
null
is returned.- param EliasHaeussler\Typo3Solver\ProblemSolving\Problem\Problem $problem
-
Problem to get a cached solution for
- returntype
-
EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Solution|null
- set ( $problem, $solution)
-
Add the given solution to the solutions cache and use the given problem to generate the cache identifier.
- param EliasHaeussler\Typo3Solver\ProblemSolving\Problem\Problem $problem
-
The problem of the solution to be cached
- param EliasHaeussler\Typo3Solver\ProblemSolving\Solution\Solution $solution
-
The solution to be cached