Enumeration caching
Enumerations (Enums) will be cached with the Flysystem driver of the Scrapbook library. We need to have a cache with the Enums themselves we are to store its ID from the database and value its name. And every enum is to store its values and its name is the name we have stored in the previously described cache. For all enums we are to store their values even if they are with an SQL query. For specific enums we will implement in the database a flag that the values should not be stored in the cache in the case of a SQL query enum. We are to store the SQL as value in the cache and then we will run the query to load it’s values. We will add an option for expiration of the cache in the enums. Default value for it is 0. If the cache expires it is to be generated again upon next calling.
For the generation of this cache we will have a script that upon deployment is to generate the full cache. The cache will be global so all of it is to be stored in /var/www/.cache/ . The script is to generate the cache of enums from the database and then for each enum it is to load its values and generate the cache for each.