EE port of: "Fix incorrect ETag cache key when relative instance URL is used"