Avoid timeout on 404 listing with large watchdog table

Created on 4 August 2017, almost 8 years ago
Updated 20 May 2025, about 5 hours ago

When viewing admin/config/search/redirect/404, the page will time out if watchdog has a large number of records. One possible way to fix this would be to create a table to hold just the 404s and use that as the basis for the query. Something along these lines:

In function redirect_404_list():
- Add a variable "redirect_404_table_last_generated" to hold a timestamp of the last time the table was updated.
- If X time has passed, do a SELECT INTO redirect_404 from watchdog to pull out all the 404 errors.
- Do a redirect back into the page so it isn't building the table and running the query in the same page request.
- Change the existing query to use the redirect_404 table instead of watchdog.

If the time is approved, I'm going to implement this for the client having the timeout problem and will provide a patch. Would love to hear any suggestions / improvements.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States michelle Wisconsin, USA

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024