Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Standard profile should set sensible performance defaults, this would be a good one to change, as well as setting max_age and possibly internal caching.
The only point against this is if you run into trouble with CSS/JS aggregation because you're trying to change a file or similar. However then you'll have to go switch it off and you'll learn what it is if you didn't already.
This seems like a good trade-off compared to sites launching without it because it never came up.
Comments
Comment #1
markpavlitski CreditAttribution: markpavlitski commentedThis patch changes the default performance settings in standard.install.
Comment #2
nod_Big +1 obviously.
Patch enable internal caching and set max-age to 1 day.
It works. Is there anything else needed for RTBC?
Comment #3
catchRe-titling, fine with these in one patch.
Comment #4
Wim LeersBig +1 to CSS/JS aggregation. Zero problems there.
Not sure about page cache's expiration being set to 1 day. What about sites with fast-changing content?
Comment #6
markpavlitski CreditAttribution: markpavlitski commented@Wim Leers Any preference on cache expiration time? At a guess, I would say that the common case usage isn't fast-changing content.
I'll work on fixing the tests to allow for this patch. Not too sure how to check for the help module CSS file being present though...
Comment #7
catch@Wim that'll eventually get solved by #1605290: Enable entity render caching with cache tag support and applying the cache tags to the page cache - then content updates can clear the parts of the page cache they affect. I'm not sure what a good default is without that.
Comment #8
markpavlitski CreditAttribution: markpavlitski commented@catch For now I've removed the max-age setting, as it also broke the search tests.
We can always look at changing it once #1605290: Enable entity render caching with cache tag support is solved.
Comment #9
Wim Leers#7: But the max_age setting is not for internal use only. It propagates into the
Cache-Control
header that is sent to browsers. So partial render cache clears would not propagate to end users, which is my concern. At least, that's what the UI text says:If this applied not to caching headers sent to visitors, but only to internal caches, then anything goes. I'd be fine with much higher values than "one day" even (though then cache size of course becomes a concern, assuming it is not bounded nor capped in LRU manner).
Comment #10
markpavlitski CreditAttribution: markpavlitski commentedMinor comment change to patch in #8.
Comment #12
markpavlitski CreditAttribution: markpavlitski commented#10: drupal-standard-profile-performance-defaults-1985084-10.patch queued for re-testing.
Comment #13
dcam CreditAttribution: dcam commentedThis seems like the kind of issue that's going to be debated for a while longer, but for what it's worth #10 does turn on all performance optimizations on install. So I'll go ahead and mark it as RTBC.
Before (un-patched installation of D8 standard profile):
After (patched installation of D8 standard profile):
Comment #14
webchickThis one has catch written alllll over it. :)
Comment #15
chx CreditAttribution: chx commentedI'd hate to block something but I have a general uneasy feeling about this going in before the rebuild script in #1872522: Compiled data in PHP storage is cleared too late in drupal_flush_all_caches()
Comment #16
catchSince I opened the issue I'd actually prefer a second opinion on this one.
Also what happens if you have internal page caching enabled but maximum age set to 0?
Comment #17
Wim Leers@catch Alsomsee my comment at #9.
Comment #18
catchComment #19
markpavlitski CreditAttribution: markpavlitski commentedThis patch provides a config file instead, but depends on the fix for #1986090: Profile config does not overwrite module default config on install (system.cron.yml).
Comment #20
olli CreditAttribution: olli commentedAfter reading the code, it seems that the internal page cache is set only if max age > 0. So you must have both (use_internal checked and max_age > 0) to enable internal page caching. That's what we have in tests too.
Comment #21
LewisNyman#19: drupal-standard-profile-performance-defaults-1985084-19.patch queued for re-testing.
Comment #23
LewisNymanThis would make me happy
Comment #24
LewisNyman23: drupal-standard-profile-performance-defaults-1985084-23.patch queued for re-testing.
Comment #26
markpavlitski CreditAttribution: markpavlitski commented#1986090: Profile config does not overwrite module default config on install (system.cron.yml) would make this much simpler.
Comment #27
markpavlitski CreditAttribution: markpavlitski commentedThis patch only covers the CSS + JS aggregation. Page caching is covered in #606840: Enable internal page cache by default
Comment #28
markpavlitski CreditAttribution: markpavlitski commentedCorrected YAML format.
Comment #31
markpavlitski CreditAttribution: markpavlitski commentedAdded missing \Drupal:: reference.
Comment #33
markpavlitski CreditAttribution: markpavlitski commentedComment #34
markpavlitski CreditAttribution: markpavlitski commented33: drupal-standard-profile-performance-defaults-1985084-33.patch queued for re-testing.
Comment #35
Wim LeersYou can check for the presence of the HTML5 shiv by looking at
drupalSettings.ajaxPageState
. There are other tests that use this that you can use as an example.Comment #36
LewisNymanI'm not sure which issue but this is now fixed.