Going forward, you can improve your Media service experience by caching data.

The benefits of caching are:

  • bandwidth reduction
  • shorter response times
  • resource savings

How it works

Each time you perform a GET request on these endpoints, the Media service provides an ETag (entity tag) for the media file you requested, and sends it in the response:

  • /public/files/{fileId}
  • /public/files/{fileId} with a query on a particular variant
  • /files/{fileId}
  • /files/{fileId} with a query on a particular variant

The ETag is always the same for a given file and, thanks to this identifier, you do not have to GET the payload multiple times for already-cached files. When you use the If-None-Match header in subsequent requests, you receive the 304 Not modified response from the service, without a payload.

If you send an incorrect ETag in the If-None-Match header, for example, the ETag for a master media file, when requesting a variant, the service returns the 200 response code, for private files - along with the payload and for public files with a redirect link.

To learn more, see the Caching section of the Media service documentation.

  • Send feedback

    If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.

  • Get Help

    Use our private help channel. Receive updates over email and contact our specialists directly.

  • hybris Experts

    If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.