Hi Rafal, you have already received many good suggestions. While ago I had a pretty similar problem, my use case was slightly different though: query log analysis... but I had the problem to find "equivalent" queries. Here is the thread: http://markmail.org/thread/vuvd2g7p2yqxtx52 from jena-users. You might find it useful.
... and, I can only agree with all the +1 around how useful can be a caching layer, even if naively implemented. ;-) Please, do keep us updated on your progress. My 2 cents, Paolo
