Cache

Overview

The cache system is a layer that sits between the database and the API. The database is the most expensive and performance-intensive aspect of the system. To mitigate this, information is loaded from the database, pre-processed, and stored in the cache. Afterwards, the API can retrieve it quickly from the cache without ever hitting the database.

The main use-case for the cache in the DigitalSeat system is to store the tag scan payload for each tag before a game begins. This way, when a user scans a tag, the API can pull the entire pre-processed payload from the cache and return it in less than a second. If it were not for the cache, the system would not be able to handle tens of thousands concurrent scans.

Scheduler

The scheduler will automatically load the payload for each tag into the cache. It does this every time it turns on a game, based on the activeDate. Likewise, it will clear the cache of each tag when it turns a game off.

Manual Reloading

The cache for a venue can be manually reloaded in the Admin Portal. To do this, click the "Reload Cache" button under the "Tags" tab of the venue page. You can see whether a tag has been cached or not by checking the "Cache" column on the tags table.

Tag Payload

The payload that is returned when a tag is scanned contains the following data:

tag:Object
game:Object
venue:Object
target:Object
brand:Object
tagGroup:Object
externalURL:String
application:Object
cached:Boolean

This information ban be viewed by going to Tag Details page. This can be accessed by clicking the shortId link on the tags table. To see if a payload is being returned for the cache or the database, you can check the cached property at the bottom.

Individual tags can be have their cache loaded or cleared by clicking the buttons next to "Edit" on the top left.

Last updated