Closed (fixed)
Project:
Prefetch Cache
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2018 at 14:15 UTC
Updated:
4 Oct 2018 at 13:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hchonovA patch based on #2994348-4: Prefetch Cache contrib module + BigPipe: prefetching .
Comment #4
hchonovAfter the discussion on #2994348: Prefetch Cache contrib module + BigPipe: prefetching and as suggested by @Wim Leers, we will disable BigPipe by decorating the BigPipe Placeholder Strategy service.
Comment #6
hchonovGiving credit to @Wim Leers for the suggested approach.
Comment #8
wim leersLGTM!
Just one remark:
Nit: s/Big Pipe/BigPipe/
This means responses now vary by
.
So you need to add that cache context to relevant HTML responses. BigPipe does something similar in
big_pipe_page_attachments(). You'll also want to implementhook_page_attachments()and add that particular cache context.Ideally you'd have a simple functional test that accesses the frontpage with and without your URL query arg, and observe BigPipe to be loaded versus not.
Comment #9
hchonovActually they don't :). If you take a look again at the code, then you'll see that at that place I check for the existence of a request attribute and not a request query parameter. The query parameter is removed from the request early in the chain in
\Drupal\prefetch_cache\StackMiddleware\PrefetchCacheBeforePageCache::handle()and the query parameter cache context isn't being added deliberately. A prefetch cache request should simulate (behave just like) a regular request and maximize the cache hits.
Comment #11
wim leersAh, right, good point! And clever :)
Comment #12
wim leersComment #13
hchonovThank you :).