set and validate http cache headers