best practice for caching content in services for servlets (cloud)
We have several servlets, e..g "register" and "login".
Some of these need to read a list of allowed countries, or swear words (so they cant create accounts with swear words in the display name etc).
If this was non-cloud we would make these OSGI configs, which have the beautiful OSGi editor tools.
However, cloud has had this removed, so we have to improvise without OSGi. We are planning to put the list of words in a txt file in DAM in csv format. Then our content editors can upload new versions whenever needed. Its pretty crude and error prone, and users could get at the data.
in our service layer, we can presumably read the DAM files using resource resolvers, queryManagers or similar.
However, reading these files on every request is going to be slow or use server resources.
Presumably we can cache them in the service layer, by just putting them into a StringBuffer or similar, and track the time they were last updated, and synchronize the methods
Is there some better way to access DAM resources which will cache between requests? The files will be rarely updated (e.g. once a month), but as we will want updates to go live quickly, we would need to poll the file every 30 mins or so.