Closed (outdated)
Project:
Drupal core
Version:
8.3.x-dev
Component:
cache system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Apr 2013 at 22:14 UTC
Updated:
18 May 2017 at 16:39 UTC
Jump to comment: Most recent
Comments
Comment #1
catchI think we need to do #1 whatever happens, then at least core is setting a good example.
#2 is tricky - some code might prevent caching based on that information or just use it for logging or similar, in which case it's not poisoning the cache and we're taking away information that might have been useful/harmless. Also if we do that I can see contrib/custom code just using raw superglobals anyway.
Also this issue isn't specific to hooks - any block that declares a particular set of dependencies but then calls out to other code, is going to run into this problem. If you have a field formatter plugin that can just as easily be accessing something in request as hook_entity_view_alter() might. With the code execution path depending on configuration it's impossible for a particular block plugin to be able to declare this stuff up front, even if everything down the rendering pipeline declares it as well there'd need to be a collection mechanism on cache misses which then figures out the cache key components for subsequent requests or similar.
Comment #2
Crell commentedMore draconian approach, which I'm not necessarily advocating: throw an E_USER_DEPRECATED error inside Drupal::request(). Normally you'd turn that off so you don't see it, but any module that is still accessing the request from a place it shouldn't (vis, that it's not been passed to it) will yell at you/the developer until it's fixed.
(As I said, not necessarily advocating that option, just pointing out that we have it.)
Comment #3
dlu commentedMoved to cache system per #2050763-16: Refine "base system" component (notes on refactoring of "base system" category here: https://docs.google.com/a/acquia.com/spreadsheet/ccc?key=0AusehVccVSq2dF...).
Comment #3.0
dlu commentedFormatting
Comment #4
catch#1 is done. Anything else depends on blocks getting context injected.
Comment #8
wim leers