Optimising query
adding caching to home page