Problem/Motivation

Yoast SEO includes an analytics library with a large file size. This library has a large footprint on PHP memory usage. When using JavaScript aggregation, this may cause PHP to run out of memory for sites running on a moderate memory limit such as 128MB. This is especially true for sites running on Drupal 10 with on-the-fly JavaScript minification enabled: https://www.drupal.org/node/3305725

Proposed resolution

Exclude the Yoast SEO analytics_core library from JavaScript preprocessing to reduce PHP memory footprint when using JavaScript aggregation

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3404287-2.patch465 bytesidebr

Comments

idebr created an issue. See original summary.

idebr’s picture

Title: Exclude analytics_core from JS preprocessing to reduce PHP memory footprint » Exclude analytics_core from JS preprocessing to reduce PHP memory footprint when using JavaScript aggregation
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new465 bytes

Attached patch excludes the Yoast SEO analytics_core library from JavaScript preprocessing to reduce PHP memory footprint

victonator’s picture

#2 works!
We upped our PHP memory limit because of this.
The patch also made our backend loading times shorter.

c_archer’s picture

The patch works and it would be good to get this reviewed and resolved.

c_archer’s picture

Status: Needs review » Reviewed & tested by the community

  • kingdutch committed 17b2f91f on 8.x-2.x
    Issue #3404287 by idebr, c_archer, victonator: Exclude analytics_core...
kingdutch’s picture

Status: Reviewed & tested by the community » Fixed

Good catch, that file should already be minified so it shouldn't be reprocessed.

Thanks for your contribution!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.