Properly setting up a simple server-side cache
问题 I'm trying to set up a server-side cache properly and I'm looking for constructive criticism on the setup I have currently. The cache is loaded when the Servlet starts and never changed again, so in effect it's a read-only cache. It obviously needs to stay in memory for the lifetime of the Servlet. Here's how I have it set-up private static List<ProductData> _cache; private static ProductManager productManager; private ProductManager() { try { lookup(); } catch (Exception ex) { _cache = null;