I am using ehcache to store a complicated object in memory the first time somebody hits the servlet. It takes almost 20 seconds to build.
When I do local testing, any return hits to the servlet pull the object out of cache instantly. However, when I upload the WAR file to a remote server, the server spends a long time doing who knows what, then it dishes out the HTML. My object appears to be pulled from the cache, but it just takes about 40 sec.
Strangly enough, if I use this remote server directly (ie, I am physically at the machine), the object is pulled from the cache instantly as it should.
Why is this behaving differently on a remote connection as opposed to a local connection?
I'm using Tomcat, btw. [ June 22, 2006: Message edited by: Trevor Price ]
Sounds as if your code is making some assumption that is true when the server and client systems are the same system, but not when they are different systems. What that might be, I have no way of knowing, but it's something for you to start with...
Found the problem by setting timers all over the place. The cache had nothing to do with it. I had set a very small response buffer size and was outputting lots and lots of code, which takes a long time over an Internet connection.