Caching will not save memory -- it will, in fact, use more memory since the cached data needs to be held in memory. If minimizing memory usage is your goal, caching would be like throwing gasoline on a fire to put it out.Originally posted by Susan Smith:
... and I think it will save some memory if I can get the data from database once and save it somewhere so each HTTP request doesn't need to query again and again from database.
Well, the JCS front page lists its advantages. If you don't need any of that. maybe a simple hash table is all you need.One other thing that I'm wondering is: why should I use caching open-source solution rather than a simple hashtable in the memory.
Caching will not save memory, it will in fact use more memory since the cached data needs to be held in memory. If minimizing memory usage is your goal, caching would be like throwing gasoline on a fire to put it out.
Originally posted by Susan Smith:
Any thoughts about how to implement caching technique in Servlets?
Bosun (SCJP, SCWCD).
So much trouble in the world -- Bob Marley
Originally posted by Susan Smith:
But let say I have 1000 user entering in at the same time.
500 of them could actually requesting the same data (supplying the same city name).
Caching it in the session will be available only per user, right?
I was thinking probably the 500 users supplying the same city name should get data from the same cache?
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|