Currently, you have to enable page cache for Drupal to sending out cacheable headers, yet it doesn't really do anything unless you also set a cache.page.maximum.age. If you set max age, you then need to give the page cache a null backend if you're using varnish to prevent drupal from also using the internal cache.
I propose that we remove the cache.page.enabled setting and replace it with cache.page.use_internal. With the attached patch, Drupal will send out the appropriate cache headers based on max age only. If you want to use the internal cache, you explicitly check that box.
I also reordered those options and reworded the descriptions to reveal what they are actually used for.
Comment | File | Size | Author |
---|---|---|---|
#28 | remove_cache_enabled_setting-1853086-28.patch | 11.8 KB | katbailey |
#23 | remove_cache_enabled_setting-1853086-23.patch | 11.75 KB | alexpott |
#22 | remove_cache_enabled_setting-1853086-22.patch | 11.93 KB | katbailey |
#9 | remove_cache_enabled_setting-1853086-9.patch | 12.65 KB | katbailey |
#9 | interdiff.txt | 1.64 KB | katbailey |
Comments
Comment #2
msonnabaum CreditAttribution: msonnabaum commentedremove_cache_enabled_setting.patch queued for re-testing.
Comment #4
msonnabaum CreditAttribution: msonnabaum commentedComment #6
msonnabaum CreditAttribution: msonnabaum commentedComment #8
catchThis makes sense to me. When we originally put in max_age support reverse proxy usage was much less common, so requiring people to figure out the null backend was deemed better than having people figure out two settings in the UI (vs. Pressflow 6.x external page cache setting). Things have moved on a bit now so it makes sense to make this configurable I think. Also making it opt-in for 'internal' page caching is conceptually easier than external page caching.
On the patch itself:
Should use double quotes rather than escaping - it's better for translators.
Also I'm not sure about putting "If a reverse proxy cache isn't available" first in that sentence, takes longer to get to what the settings actually does, although the second bit also duplicates the form label so meh.
Comment #9
katbailey CreditAttribution: katbailey commentedThis should fix the remaining test; it also addresses @catch's point about quotes in #8.
Comment #10
katbailey CreditAttribution: katbailey commentedOh, hmm - we can't use a config setting as the basis on which to decide whether to wrap the kernel in HttpCache as per #1597696: Consider whether HttpCache offers any significant benefit over the existing page cache. It needs to be a $conf var in settings.php because we can't get config before booting the kernel, but on cached pages we don't want to boot the kernel. Or am I missing something?
Comment #11
msonnabaum CreditAttribution: msonnabaum commentedI think you're right, but it's not a sure thing that we'll even use the HttpCache wrapper, so probably not relevant for this thread.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedyeah, there's still a slim chance of killing the fake http insanity that symfony loves, so hopefully we'll never use HttpCache.
Comment #13
Crell CreditAttribution: Crell commentedSwitching to HttpCache is still the goal. I really don't know what your obsession is with "Fake HTTP". The entire point of HttpFoundation is to abstract the request away from the "real" superglobals so that 99% of the code doesn't know what's "real" and what's "fake" because that's a meaningless distinction.
Comment #14
msonnabaum CreditAttribution: msonnabaum commentedThis issue has nothing to do with HttpCache. Please take the discussion elsewhere.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedmsonnabaum - sorry :-\
Comment #16
catchMoving this to settings.php means there's no longer a UI for it. I could possibly live with that if we enable this by default and force people to disable it, although not sure that'll be a popular suggestion.
Comment #17
Crell CreditAttribution: Crell commentedI don't think we can make that determination until we're done deciding what the cache setup is going to look like, and therefore what the cache lifetime actually affects. Stupid related problem spaces...
Comment #18
msonnabaum CreditAttribution: msonnabaum commentedAnything settings.php related is an issue with potential HttpCache implementations.
I dont see how this issue affects that one way or the other.
Comment #19
catch#9: remove_cache_enabled_setting-1853086-9.patch queued for re-testing.
Comment #21
moshe weitzman CreditAttribution: moshe weitzman commentedNeeds a reroll.
Comment #22
katbailey CreditAttribution: katbailey commentedComment #23
alexpottRerolled due to hook_boot() removal. I like this change and I think it's ready to be RTBC'd...
Comment #24
Crell CreditAttribution: Crell commentedI think we're good here.
Comment #25
Dries CreditAttribution: Dries commented#23: remove_cache_enabled_setting-1853086-23.patch queued for re-testing.
Comment #27
Dries CreditAttribution: Dries commentedThis looks good to go to me (nice clean-up) but I think this may need another re-roll.
Comment #28
katbailey CreditAttribution: katbailey commentedComment #29
katbailey CreditAttribution: katbailey commentedIt was just a straight-up re-roll, so setting back to RTBC.
Comment #30
webchickSince this already passed Dries's sniff test,
Committed and pushed to 8.x. Thanks!