Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware should not make table check on each request #563

Closed
2 tasks done
lekoala opened this issue Mar 21, 2024 · 1 comment · Fixed by #564
Closed
2 tasks done

Middleware should not make table check on each request #563

lekoala opened this issue Mar 21, 2024 · 1 comment · Fixed by #564

Comments

@lekoala
Copy link
Contributor

lekoala commented Mar 21, 2024

Module version(s) affected

3.x

Description

Currently, the middleware make a table check on each request. While not super expensive, it feels that this is really unecessary

image

Related issues:

silverstripe/silverstripe-framework#11181
tractorcow-farm/silverstripe-fluent#828

How to reproduce

Install debugbar
Install subsite module
Check the queries: a SHOW TABLES LIKE 'SubsiteDomain' happen in each query

Possible Solution

Don't make the check except on dev/build:
tractorcow-farm/silverstripe-fluent#831

Rely on the cached ClassInfo::hasTable instead which will get even better in the future
silverstripe/silverstripe-framework#11183

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

PRs

@GuySartorelli
Copy link
Member

Pr is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants