摘要 |
The invention discloses a method and a device for data caching. The method includes: maintaining importance information for each element in a caching pool according to elements newly added into the caching pool each time and hit counts of added elements in the caching pool; and when the elements in the caching pool need to be cleaned each time, referencing to sorted results of the elements in the caching pool, and cleaning the elements stored in the caching pool, wherein the sorted results are obtained by sorting the elements in the caching pool according to the importance information maintained for each element in the caching pool, and according to preset rules. By the method and the device, flexibility of data caching of a client side based on a WEB system can be well improved, high hit rate when data are accessed under the circumstance of low system resource occupancy is achieved, and accordingly system performance is improved. |