We have implemented chat using open-fire. Everything works fine except for that every I load my page, Many(no. of users on chat) queries are getting fired.
SELECT salt, serverKey, storedKey, iterations, name, email, creationDate, modificationDate FROM ofUser WHERE username='1'
SELECT salt, serverKey, storedKey, iterations, name, email, creationDate, modificationDate FROM ofUser WHERE username='2'
SELECT salt, serverKey, storedKey, iterations, name, email, creationDate, modificationDate FROM ofUser WHERE username='3'
..
..
..
..
SELECT salt, serverKey, storedKey, iterations, name, email, creationDate, modificationDate FROM ofUser WHERE username='100'
Please help as i feel these many queries on page load will shut down by server at peak hours.
Is there any way to cache these queries?