graff, by query I do not mean sql query. My files are not in DB, I do not use DB at all.
Yes, retrieving data from HD takes much more time than processing and again I know how to rearrange my code to retrieve it just once.
Yes my data fits RAM.
I just want to know if it's possible to do caching (besides OS caching) without rearranging the code.