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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markpavlitski’s picture

Status: Active » Needs review
FileSize
1.4 KB

This patch changes the default performance settings in standard.install.

nod_’s picture

Big +1 obviously.

Patch enable internal caching and set max-age to 1 day.

It works. Is there anything else needed for RTBC?

catch’s picture

Title: Enable CSS and JavaScript aggregation by default in the standard profile » Enable sensible performance defaults in the standard profile

Re-titling, fine with these in one patch.

Wim Leers’s picture

Title: Enable sensible performance defaults in the standard profile » Enable CSS and JavaScript aggregation by default in the standard profile

Big +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?

Status: Needs review » Needs work

The last submitted patch, drupal-standard-profile-performance-defaults-1985084-1.patch, failed testing.

markpavlitski’s picture

@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...

catch’s picture

@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.

markpavlitski’s picture

Status: Needs work » Needs review
FileSize
2.68 KB

@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.

Wim Leers’s picture

#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:

The maximum time a page can be cached. This is used as the value for max-age in Cache-Control headers.

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).

markpavlitski’s picture

Minor comment change to patch in #8.

Status: Needs review » Needs work
Issue tags: -Performance, -frontend performance

The last submitted patch, drupal-standard-profile-performance-defaults-1985084-10.patch, failed testing.

markpavlitski’s picture

Status: Needs work » Needs review
Issue tags: +Performance, +frontend performance
dcam’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
11.51 KB
9.42 KB

This 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):

before.png

After (patched installation of D8 standard profile):

after.png

webchick’s picture

Assigned: Unassigned » catch

This one has catch written alllll over it. :)

chx’s picture

I'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()

catch’s picture

Status: Reviewed & tested by the community » Needs review

Since 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?

Wim Leers’s picture

@catch Alsomsee my comment at #9.

catch’s picture

Assigned: catch » Unassigned
markpavlitski’s picture

olli’s picture

Also what happens if you have internal page caching enabled but maximum age set to 0?

After 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.

LewisNyman’s picture

Status: Needs review » Needs work
Issue tags: +Performance, +frontend performance

The last submitted patch, drupal-standard-profile-performance-defaults-1985084-19.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
1.68 KB

This would make me happy

LewisNyman’s picture

Status: Needs review » Needs work
markpavlitski’s picture

Status: Needs work » Needs review
FileSize
1.76 KB

This patch only covers the CSS + JS aggregation. Page caching is covered in #606840: Enable internal page cache by default

markpavlitski’s picture

Corrected YAML format.

Status: Needs review » Needs work

markpavlitski’s picture

Status: Needs work » Needs review
FileSize
1.78 KB

Added missing \Drupal:: reference.

Status: Needs review » Needs work
markpavlitski’s picture

Status: Needs work » Needs review
FileSize
2.99 KB
markpavlitski’s picture

Wim Leers’s picture

Status: Needs review » Needs work
+++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
@@ -64,11 +64,19 @@ public function testHelp() {
+    // Disable css aggregation so we can check if help.css exists.

+++ b/core/modules/system/lib/Drupal/system/Tests/Common/NoJavaScriptAnonymousTest.php
@@ -35,6 +35,11 @@ protected function setUp() {
+    // Disable JS aggregation so we can check for HTML5 shiv.

You 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.

LewisNyman’s picture

Status: Needs work » Closed (fixed)

I'm not sure which issue but this is now fixed.