Skip to main content

Why does the Cache-Control header contain both 'public' and 'private'?



  • Takashi Futada

    So in case that f_auto is specified, no images are cached in edge servers,  every single request from web browsers hits the Cloudinary image server, which could reside in US?

    I mean that most of our users are from Japan, so every traffic rounds trip the pacific ocean?

  • Raz Ziv

    Hi Takashi,

    No worries, the requests are cached on the CDN itself after the f_auto directive converts into the equivalent best-format per browser URL. For example, assuming the request was made via a Chrome browser, most likely a WebP image will be returned, so the will actually be converted on the CDN to and this URL will indeed be cached on the CDN. Further requests from Chrome will return the cached WebP image that is returned when converting the URL to behind the scenes.
    The `private` attribute in the Cache-Control header is only intended for directing other proxies along the way to avoid caching the URL as well, so the functionality of the `f_auto` algorithm on the CDN won't be unintentionally interfered.

    I hope this makes sense. Please let me know if anything requires further clarification.


  • Takashi Futada

    I see. The url is tweaked and then used as a key to the image. I got it.


Please sign in to leave a comment.