This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am loading a cache in 'init' method of servlet. The cache holds various exceptions which are sent to different exception buckets on screen.
Now as the number of exceptions are too high, it takes a long time (around 30 min) to load the cache. Untill the cache is loaded the servlet does not show up. So servlet start up time is causing performance issues.
Is there any way through which first exception cacheing is handled by some script or different method in servlet and then the servlet comes up?
How to reduce the start up time for this servlet, considering amount of cacheing required? Please let me know if any more information is required.
Does the servlet need the cache for its work? If so, I don't see a way around waiting for that time until it can assume operation. If not, I'd move the cache initialization to a ServletContextListener that runs independently of any servlet.
Joined: Aug 29, 2007
Servlet uses the cache in doGet method, any option through which I can load the cache before servlet startup just use it in servlet?
I am not sure how <load-on-startup> tag will benefit me in this case, I am already using it with value as '1', as the concerned servlet should be the first one to get loaded.
The problem is that due to cacheing happening in 'init(servletConfig)' method, load up time is shooting up.
I dont have a fare clue if a perl script can do my job (cacheing) beforehand and I can just use the object wherever required. I am also not definitely aware if using 'init()' method for cacheing will help. Any insights on this?