{"data":{"id":"magento2-39704","source":"github-pr","sourceRef":"magento/magento2#39704","title":"Duplicate cache fpc for same page with same query when use varnish","pr":{"number":39704,"url":"https://github.com/magento/magento2/pull/39704","author":"rogerdz","mergedAt":"2025-12-23T16:16:29Z","mergeCommit":"a35c01aac6bcf0cf2a33c7a036a989eb683cc293","headCommit":"9c61dfad6bad30b46c626501a15320c1140ca26b","baseRef":"2.4-develop","diffSha256":"03d16e859bccab224fd2e121bec7ae0681f9bf1a7f1ff828483eda15d82f9011"},"issues":[{"number":39706,"url":"https://github.com/magento/magento2/issues/39706","title":"[Issue] Duplicate cache fpc for same page with same query when use varnish","labels":["Area: Framework","Component: PageCache","Issue: Confirmed","Priority: P2","Progress: done","Reproduced on 2.4.x","Triage: Dev.Experience"],"kind":"pr-derived"}],"fixedIn":"2.4.9","containingTags":["2.4.9"],"reportedOn":null,"codeMatch":{"2.4.6":"file-missing","2.4.6-p1":"file-missing","2.4.6-p2":"file-missing","2.4.6-p3":"file-missing","2.4.6-p4":"file-missing","2.4.6-p5":"file-missing","2.4.6-p6":"file-missing","2.4.6-p7":"file-missing","2.4.6-p8":"file-missing","2.4.6-p9":"file-missing","2.4.6-p10":"file-missing","2.4.6-p11":"file-missing","2.4.6-p12":"file-missing","2.4.6-p13":"file-missing","2.4.6-p14":"file-missing","2.4.6-p15":"file-missing","2.4.7":"file-missing","2.4.7-p1":"file-missing","2.4.7-p2":"file-missing","2.4.7-p3":"file-missing","2.4.7-p4":"file-missing","2.4.7-p5":"file-missing","2.4.7-p6":"file-missing","2.4.7-p7":"file-missing","2.4.7-p8":"file-missing","2.4.7-p9":"file-missing","2.4.7-p10":"file-missing","2.4.8":"clean","2.4.8-p1":"clean","2.4.8-p2":"clean","2.4.8-p3":"clean","2.4.8-p4":"clean","2.4.8-p5":"clean","2.4.9":"conflict"},"affectedVersions":["2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5"],"components":["magento/module-page-cache"],"files":[{"path":"app/code/Magento/PageCache/etc/varnish4.vcl","change":"modified","package":"magento/module-page-cache"},{"path":"app/code/Magento/PageCache/etc/varnish5.vcl","change":"modified","package":"magento/module-page-cache"},{"path":"app/code/Magento/PageCache/etc/varnish6.vcl","change":"modified","package":"magento/module-page-cache"},{"path":"app/code/Magento/PageCache/etc/varnish7.vcl","change":"modified","package":"magento/module-page-cache"}],"stripped":{"tests":[],"docs":[],"outsideCode":[]},"linesChanged":20,"mergeBatched":false,"excluded":null,"sections":{"description":"Same as https://github.com/magento/magento2/issues/38269 but for varnish\nInspire by: https://varnish-cache.org/docs/trunk/reference/vmod_std.html#string-querysort-string","stepsToReproduce":"1. Setup magento with varnish\n2. Clear cache: bin/magento cache:clean\n3. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?activity=8&style_bags=24' | grep -i X-Magento-Cache-Debug, it will return x-magento-cache-debug: MISS => correct\n4. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?activity=8&style_bags=24' | grep -i X-Magento-Cache-Debug, it will return x-magento-cache-debug: HIT => correct\n5. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?style_bags=24&activity=8' | grep -i X-Magento-Cache-Debug => it return x-magento-cache-debug: MISS => wrong\n6. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?activity=8&style_bags=24&' | grep -i X-Magento-Cache-Debug => it return x-magento-cache-debug: MISS => wrong","expectedResult":null,"actualResult":null,"source":"pr"},"signatures":[],"labels":{"area":["Framework"],"component":["PageCache"],"priority":"P2","severity":null,"reportedOn":[]},"categories":["Cache"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"7cda2fc7b1f00859b08aa3450ca876050d75103d1677df53b77fbd590bbd5582","isBugfix":0.9631,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9389,"feature":0.0212,"refactor":0.0138,"tests_only":0.0049,"docs_only":0.0042,"dependency":0.0049,"cleanup":0.0121},"confidence":0.8627},"scope":{"score":0.3794,"probabilities":{"0":0.6875,"1":0.2456,"2":0.0669},"confidence":0.3062},"risk":{"score":0.4221,"probabilities":{"0":0.6217,"1":0.3346,"2":0.0437},"confidence":0.2505},"area":{"choice":"framework","probabilities":{"catalog":0.0071,"checkout":0.0048,"customer":0.0034,"admin":0.0051,"graphql_api":0.0029,"framework":0.9435,"frontend":0.0148,"other":0.0184},"confidence":0.8753},"securityRelevant":0.0067,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0032,"2.4.0-p1":0.0039,"2.4.1":0.0037,"2.4.1-p1":0.0036,"2.4.2":0.0054,"2.4.2-p1":0.0051,"2.4.2-p2":0.0055,"2.4.3":0.0086,"2.4.3-p1":0.0082,"2.4.3-p2":0.0097,"2.4.3-p3":0.0053,"2.4.4":0.0143,"2.4.4-p1":0.0103,"2.4.4-p10":0.0065,"2.4.4-p11":0.0068,"2.4.4-p12":0.0065,"2.4.4-p13":0.0061,"2.4.4-p14":0.0078,"2.4.4-p15":0.0054,"2.4.4-p16":0.0069,"2.4.4-p17":0.0058,"2.4.4-p18":0.0058,"2.4.4-p2":0.0025,"2.4.4-p3":0.0027,"2.4.4-p4":0.0029,"2.4.4-p5":0.0039,"2.4.4-p6":0.0038,"2.4.4-p7":0.0039,"2.4.4-p8":0.004,"2.4.4-p9":0.0038,"2.4.5":0.0134,"2.4.5-p1":0.0118,"2.4.5-p10":0.0068,"2.4.5-p11":0.0106,"2.4.5-p12":0.0101,"2.4.5-p13":0.0075,"2.4.5-p14":0.0071,"2.4.5-p15":0.0063,"2.4.5-p16":0.0088,"2.4.5-p17":0.0076,"2.4.5-p2":0.0034,"2.4.5-p3":0.0043,"2.4.5-p4":0.0068,"2.4.5-p5":0.0053,"2.4.5-p6":0.0053,"2.4.5-p7":0.0059,"2.4.5-p8":0.0046,"2.4.5-p9":0.0041,"2.4.6":0.0304,"2.4.6-p1":0.0216,"2.4.6-p10":0.0089,"2.4.6-p11":0.0121,"2.4.6-p12":0.0117,"2.4.6-p13":0.0095,"2.4.6-p14":0.0109,"2.4.6-p15":0.0077,"2.4.6-p2":0.005,"2.4.6-p3":0.0072,"2.4.6-p4":0.0087,"2.4.6-p5":0.0068,"2.4.6-p6":0.0091,"2.4.6-p7":0.0092,"2.4.6-p8":0.0063,"2.4.6-p9":0.0049,"2.4.7":0.0226,"2.4.7-p1":0.0207,"2.4.7-p10":0.0092,"2.4.7-p2":0.0114,"2.4.7-p3":0.0156,"2.4.7-p4":0.0177,"2.4.7-p5":0.0151,"2.4.7-p6":0.0154,"2.4.7-p7":0.0134,"2.4.7-p8":0.0095,"2.4.7-p9":0.0066,"2.4.8":0.0216,"2.4.8-p1":0.0169,"2.4.8-p2":0.0191,"2.4.8-p3":0.0194,"2.4.8-p4":0.0172,"2.4.8-p5":0.0137,"2.4.9":0.0229,"unspecified":0.2404},"confidence":0.0561},"backportWorthy":{"score":1.5577,"probabilities":{"0":0.0962,"1":0.2499,"2":0.6539},"confidence":0.2489}},"curated":{"title":"Varnish makes a duplicate cache for the same page with the same query","description":"With varnish, the same page with the same query, like activity=8&style_bags=24 and style_bags=24&activity=8, gets a MISS and a duplicate cache. The varnish4 to varnish7 vcl files now sort query string parameters with std.querysort in vcl_recv when the URL has two or more.","categories":["Cache"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-39704 details"}