Java Web Application: How to implement caching techniques?

前端 未结 6 2040
别那么骄傲
别那么骄傲 2020-12-12 18:16

I am developing a Java web application that bases it behavior through large XML configuration files that are loaded from a web service. As these files are not actually requi

6条回答
  •  暖寄归人
    2020-12-12 18:57

    Option #1: Use an Open Source Caching Library Such as EHCache

    Don't implement your own cache when there are a number of good open source alternatives that you can drop in and start using. Implementing your own cache is much more complex than most people realize and if you don't know exactly what you are doing wrt threading you'll easily start reinventing the wheel and resolving some very difficult problems.

    I'd recommend EHCache it is under an Apache license. You'll want to take a look at the EHCace code samples.

    Option #2: Use Squid

    An even easier solution to your problem would be to use Squid... Put Squid in between the process that requests the data to be cached and the system making the request: http://www.squid-cache.org/

提交回复
热议问题