1

I built a site with Drupal 9 and webform. The form consists of three pages and contains a few computed fields. On the first page are mandatory fields. The form is used by logged-in users only.

When on a machine with a normal/fast internet connection, everything is fine. When on a machine (smartphone) with a slow internet connection (or on Low-end mobile in Chromium's developer tools), I can enter all information on the first page, press next, it loads the second page and jumps back to the first one, claiming that the mandatory fields were empty.

Is there something that should be cached and that I missed so far? Do I have to manipulate some timeouts (where are they, I didn't find them)?

0

To enable all caching:

  • Navigate to "Extend" and enable the following modules:
    • Internal page cache
    • Internal dynamic page cache
  • Navigate to "Configuration > Development > Performance" and enable cache for a period of time (E.g. 6 hours) and check both the options for "Aggregrate CSS/JS"

Hopefully that may help with your issue.

2
  • Since the OP doesn't seem to ask for anonymous users, it should be said that the Internal Page module caches pages for anonymous users. If the webform is submitted from registered users, that module would not cache the webform. (It would not probably cache any form too.) – apaderno Jan 12 at 8:53
  • I updated the question to make it clear that it is about logged-in users only. The modules are already active and the aggregation settings are already active. The cache time period was not set, but setting it didn't change the behaviour. – flauschi Jan 12 at 10:33
0

I tried the Advanced Aggregation module. This gave me the hint that the scripts should be compressed. Since the application is served by an nginx server, I had to update the server configuration by adding the gzip line to the following snippe:

location ~ ^/sites/.*/files/(css|js) {
   # add_header Cache-Control 'public, max-age=31536000, immutable';
    gzip_static on;
}

At least with my local testing scenario (Low-end mobile in Chromium's developer tools) it does the trick. We'll see, whether it does so in real world low internet connections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.