document cache middleware usage