-
Notifications
You must be signed in to change notification settings - Fork 4
Caching
The programmes plant makes use of a number of internal caches in order to ensure requests to the API's as well general page loads can be displayed as quickly as possible.
All SimpleData datastores have 2 caches each, one containing a copy of their current data and the rest a pre-generated list used for populating drop-downs.
All Revisionable items then create caches for the published instance of each programme by instance ID and year.
Programmes in addition to the revisonble cache also mains an attributes cache as well as an index & relations mapping index file.
All the above caches are generated on save, to ensure they are always warn in normal operation of the programmes plant. Missing caches will be regenerated on demand.
The Output cache is used to store finalised results that can be used directly as a response to API calls. These caches are generated based on data found in the level one caches & are created on demand.
The modules cache is generated by a task, which calls a number of API's external to the programmes plant itself. Previews are generated in the same way as the level 2 caches, expect they are built from live data rather than directly from the level 1 caches.
The PG deliveries utilise a two stage cache. Each time a delivery is updated it is stored in a cache file named with the year and Instance ID of the course it belongs to. Each cache file may contain multiple deliveries (as many as there are for a given programme).
When an output cache is generated for a PG programme API::combine_programme()
, the API will attempt to find a cache for that programmes instance ID & year in the deliveries cache folder ( pg-deliveries/x-xxxx
), if the cache is found the deliveries will be added to that programmes output. (in addition to populating the award name data & appending relevant module data)