Small performance optimizations

Small performance optimizations ( cache Id and request URL was made as indexed fields in DB,  logic of saving cache was optimized)