Title: milcomp's Replies | WordPress.org

---

# milcomp

  [  ](https://wordpress.org/support/users/milcomp/)

 *   [Profile](https://wordpress.org/support/users/milcomp/)
 *   [Topics Started](https://wordpress.org/support/users/milcomp/topics/)
 *   [Replies Created](https://wordpress.org/support/users/milcomp/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/milcomp/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/milcomp/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/milcomp/engagements/)
 *   [Favorites](https://wordpress.org/support/users/milcomp/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Converter for Media - Optimize images | Convert WebP & AVIF] Using Cloudflare PRO with this plugin](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/)
 *  Thread Starter [milcomp](https://wordpress.org/support/users/milcomp/)
 * (@milcomp)
 * [5 months ago](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/#post-18726854)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) Did
   you test it with an added Cookie header as well? 🙂 Try it, it won’t be a Cache
   HIT.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Converter for Media - Optimize images | Convert WebP & AVIF] Using Cloudflare PRO with this plugin](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/)
 *  Thread Starter [milcomp](https://wordpress.org/support/users/milcomp/)
 * (@milcomp)
 * [5 months ago](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/#post-18726846)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) Yes,
   I understand that from the plugin’s perspective everything is configured correctly.
   However, the issue is that in practice, it doesn’t work on real production sites.
 * The problem is that Cloudflare PRO plan does not cache resources with Vary: Accept
   header when cookies are present in the request – and practically every visitor
   has tracking cookies (Google
   Analytics, Facebook Pixel, marketing tools, etc.).
 * So while your plugin correctly configures everything and removes Cache-Control:
   private, Cloudflare itself bypasses the cache due to the combination of cookies
   + Vary header. This means:
    - ✅ Works in testing (curl without cookies) → HIT
    - ❌ Fails in production (real users with cookies) → BYPASS
    - ❌ No CDN benefit, all traffic hits origin server If your plugin’s concept
      relies on Cloudflare’s “Vary for Images” feature, you should be aware: It 
      will not work on most real-world sites where visitors have tracking cookies–
      which is basically
      every site using analytics.
 * This appears to be a Cloudflare PRO plan limitation, not a plugin issue. But 
   it makes the nginx routing approach incompatible with real production CDN usage.
 * Perhaps the documentation should mention this limitation, or consider an alternative
   approach that doesn’t rely on Vary: Accept for sites on Cloudflare PRO plans?
 * Cheers!
   Marton
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Converter for Media - Optimize images | Convert WebP & AVIF] Using Cloudflare PRO with this plugin](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/)
 *  Thread Starter [milcomp](https://wordpress.org/support/users/milcomp/)
 * (@milcomp)
 * [5 months ago](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/#post-18726796)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) I 
   discovered the root cause of the BYPASS issue. It’s related to cookies in the
   request.
 * Test Results:
 * When I test with curl without cookies, I get a HIT:
   curl -I “[https://vates.hu/wp-content/uploads/2025/11/image.jpg&#8221](https://vates.hu/wp-content/uploads/2025/11/image.jpg&#8221);\-
   H “Accept: image/webp”Result: CF-Cache-Status: HIT ✅
 * However, when I include cookies (like the ones set by WordPress analytics plugins
   such as Sourcebuster.js – sbjs_* cookies, or Facebook Pixel _fbp cookies), I 
   get BYPASS:
   curl -I “[https://vates.hu/wp-content/uploads/2025/11/image.jpg&#8221](https://vates.hu/wp-content/uploads/2025/11/image.jpg&#8221);\-
   H “Accept: image/webp” \-H “Cookie: sbjs_migrations=…; _fbp=…”Result: CF-Cache-
   Status: BYPASS ❌
 * The Problem:
 * In real-world production environments, almost all visitors have cookies set by
   analytics/marketing plugins (Google Analytics, Facebook Pixel, etc.). This means
   images are never cached by Cloudflare
   CDN – defeating the entire purpose of using
   a CDN.
 * According to [https://developers.cloudflare.com/cache/advanced-configuration/vary-for-images/](https://developers.cloudflare.com/cache/advanced-configuration/vary-for-images/),
   the “Vary for Images” feature should work with PRO plans. However, it appears
   that when the Vary:
   Accept header is combined with cookies in the request, Cloudflare
   bypasses the cache.
 * I’ve already tried:
    - ✅ Cloudflare Variants API is configured correctly (shown in my previous message)
    - ✅ Removed Cache-Control: private from nginx config
    - ✅ Created Cache Rules in Cloudflare to force caching for /wp-content/uploads/*
    - ✅ Purged Cloudflare cache multiple times
    - ❌ Still getting BYPASS when cookies are present
 * _Question: Is this a known limitation of the Cloudflare PRO plan with the Vary:
   Accept header? Does this plugin only work properly with Cloudflare Business/Enterprise
   plans, or am I missing something in the configuration?_
 * Any guidance would be greatly appreciated!
 * Best,
   Marton
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Converter for Media - Optimize images | Convert WebP & AVIF] Using Cloudflare PRO with this plugin](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/)
 *  Thread Starter [milcomp](https://wordpress.org/support/users/milcomp/)
 * (@milcomp)
 * [5 months ago](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/#post-18726707)
 * What I really don’t understand, that in CF the Vary is successfully configured
   by the plugin:
 *     ```wp-block-code
       curl "https://api.cloudflare.com/client/v4/zones/3df2cfb4672039e0df74d3b33b98ab30/cache/variants" \    --header "Authorization: Bearer ***"  {    "result": {      "editable": true,      "id": "variants",      "modified_on": "2025-11-20T13:09:13.770148Z",      "value": {        "gif": [          "image/gif",          "image/webp",          "image/avif"        ],        "jpeg": [          "image/jpeg",          "image/webp",          "image/avif"        ],        "jpg": [          "image/jpeg",          "image/webp",          "image/avif"        ],        "png": [          "image/png",          "image/webp",          "image/avif"        ],        "webp": [          "image/webp",          "image/avif"        ]      }    },    "success": true,    "errors": [],    "messages": []  }
       ```
   
 * However, still no HIT :’)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Converter for Media - Optimize images | Convert WebP & AVIF] Using Cloudflare PRO with this plugin](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/)
 *  Thread Starter [milcomp](https://wordpress.org/support/users/milcomp/)
 * (@milcomp)
 * [5 months ago](https://wordpress.org/support/topic/using-cloudflare-pro-with-this-plugin/#post-18726686)
 * Thanks for the quick Reply! I sent you on Slack and to the [hello@mattplugins.com](https://wordpress.org/support/users/milcomp/replies/hello@mattplugins.com?output_format=md)
   address as well. Sorry, wouldn’t share the hosting details here, I hope you understand.
   Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)