refactor page cacheing