Page Cache duplicating responses for subrequests

Created on 14 June 2019, over 5 years ago
Updated 21 February 2023, over 1 year ago

In the request below, if page cache is enabled, I receive the response for the 1st subrequest as the response for the 2nd subrequest. I am requesting as an anonymous user.

I traced the issue as far as the call to PageCache::get in which the call to get the cache id generates the same id for both subrequests.
$cid = $this->getCacheId($request);

Disabling the page cache in services fixes the issue.
$settings['cache']['bins']['page'] = 'cache.backend.null';

NB I have applied the patch in the following issue to avoid validation errors, without which the request is ignored as invalid. I don't think this is is the culprit, but I'm not 100% https://www.drupal.org/project/subrequests/issues/3029570 β†’ .

Subrequest blueprint:

[
	{
		"requestId": "router",
		"action": "view",
		"uri": "/router/translate-path?path=/page/er-layout&_format=json"
	},
	{
		"requestId": "resolvedResource",
		"action": "view",
		"uri": "{{router.body@$.jsonapi.individual}}",
		"headers": {
    		  "Accept": "application/vnd.api+json",
    		  "Content-Type": "application/json"
    	        },
		"waitFor": [
			"router"
		]
		
	}
]
πŸ› Bug report
Status

Closed: duplicate

Version

2.2

Component

Code

Created by

πŸ‡¦πŸ‡·Argentina weemondo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024