Refactors cache usage and HTTP headers