{"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":"725bc7918b382bac1b8f2e90461c9040b468c00e94fdd90ceeab65bb0c8ed55a","isBugfix":0.9638,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9443,"feature":0.0216,"refactor":0.0181,"tests_only":0.0053,"docs_only":0.0049,"dependency":0.0058},"confidence":0.8712},"scope":{"score":0.4224,"probabilities":{"0":0.6428,"1":0.292,"2":0.0652},"confidence":0.254},"risk":{"score":0.4096,"probabilities":{"0":0.6289,"1":0.3327,"2":0.0384},"confidence":0.2615},"area":{"choice":"framework","probabilities":{"catalog":0.0068,"checkout":0.0046,"customer":0.0034,"admin":0.005,"graphql_api":0.0028,"framework":0.9455,"frontend":0.0157,"other":0.0162},"confidence":0.8796},"securityRelevant":0.0072,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0033,"2.4.0-p1":0.0041,"2.4.1":0.0036,"2.4.1-p1":0.0036,"2.4.2":0.0055,"2.4.2-p1":0.0053,"2.4.2-p2":0.0059,"2.4.3":0.0103,"2.4.3-p1":0.0095,"2.4.3-p2":0.0094,"2.4.3-p3":0.0061,"2.4.4":0.0136,"2.4.4-p1":0.0105,"2.4.4-p10":0.0068,"2.4.4-p11":0.0076,"2.4.4-p12":0.0067,"2.4.4-p13":0.0062,"2.4.4-p14":0.0085,"2.4.4-p15":0.0055,"2.4.4-p16":0.0071,"2.4.4-p17":0.0057,"2.4.4-p18":0.0052,"2.4.4-p2":0.0022,"2.4.4-p3":0.0026,"2.4.4-p4":0.0027,"2.4.4-p5":0.0035,"2.4.4-p6":0.004,"2.4.4-p7":0.0033,"2.4.4-p8":0.0039,"2.4.4-p9":0.0036,"2.4.5":0.0147,"2.4.5-p1":0.0121,"2.4.5-p10":0.0073,"2.4.5-p11":0.012,"2.4.5-p12":0.0091,"2.4.5-p13":0.009,"2.4.5-p14":0.008,"2.4.5-p15":0.0065,"2.4.5-p16":0.0086,"2.4.5-p17":0.008,"2.4.5-p2":0.0032,"2.4.5-p3":0.0041,"2.4.5-p4":0.0057,"2.4.5-p5":0.005,"2.4.5-p6":0.0053,"2.4.5-p7":0.0065,"2.4.5-p8":0.0046,"2.4.5-p9":0.0049,"2.4.6":0.0312,"2.4.6-p1":0.0228,"2.4.6-p10":0.0097,"2.4.6-p11":0.0136,"2.4.6-p12":0.0114,"2.4.6-p13":0.0106,"2.4.6-p14":0.0101,"2.4.6-p15":0.0079,"2.4.6-p2":0.0048,"2.4.6-p3":0.0068,"2.4.6-p4":0.0088,"2.4.6-p5":0.0065,"2.4.6-p6":0.0076,"2.4.6-p7":0.0096,"2.4.6-p8":0.0068,"2.4.6-p9":0.0053,"2.4.7":0.0216,"2.4.7-p1":0.023,"2.4.7-p10":0.0099,"2.4.7-p2":0.0143,"2.4.7-p3":0.016,"2.4.7-p4":0.0167,"2.4.7-p5":0.0137,"2.4.7-p6":0.0149,"2.4.7-p7":0.0131,"2.4.7-p8":0.0104,"2.4.7-p9":0.0063,"2.4.8":0.0205,"2.4.8-p1":0.0175,"2.4.8-p2":0.0195,"2.4.8-p3":0.02,"2.4.8-p4":0.017,"2.4.8-p5":0.0147,"2.4.9":0.0207,"unspecified":0.2263},"confidence":0.0498},"backportWorthy":{"score":1.5359,"probabilities":{"0":0.1029,"1":0.2583,"2":0.6388},"confidence":0.2281}},"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"}