Performance regression with webform module after #3337669

Created on 13 May 2024, about 1 month ago
Updated 21 June 2024, 6 days ago

Problem/Motivation

After #3337669 πŸ› Not showing newly updated/changed file on Pantheon - Cache issue Needs review , we are seeing performance issues, specifically with webform image uploads.

The change in that issue makes each individual image upload an O(n) operation, N being the amount of image styles on your site. This means that if a user uploads 5 images, your site has 9 image styles, and each request to edge-cache-clearer.svc.pantheon.io takes 760ms, the submission will take 34 seconds. See below for a real world example:

The webform module initially uploads files into a temp folder, and then once the user submits the form, moves them to a permanent folder in the private filesystem based on the submission ID. This update of the file entity triggers the pantheon_advanced_page_cache_file_update hook and all of the subsequent HTTP requests.

Steps to reproduce

  1. On a site with the webform and pantheon_advanced_page_cache modules, set up a webform with an image upload field.
  2. Upload a few images to the webform. Set a breakpoint / print statement on the pantheon_advanced_page_cache_file_update hook. Submit the form and see that the hook is called for each image file.

Proposed resolution

The simplest solution would be to ignore any file entities that are on the private filesystem. These shouldn't be cached in the CDN anyways since it requires authentication, and therefore do not need to be invalidated.

Another solution would be to add an exclude list for URLs that should be ignored by the module.

πŸ› Bug report
Status

Needs review

Version

2.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024