Closed rob-baker-ar closed 4 months ago
hmmmm. Yeah seems to me that for frontend requests, we could just skip this entirely, since it'll never be used
Addressed in the above commits.
I just cut a release version too, lmk how you go. Just do:
composer update nystudio107/craft-plugin-vite
...and that should do it
In the interests of an update: This seems to have done the trick. Thank you.
I was not sure where exactly to report this as I noticed it coming via Retour & SEOMatic, but the common element is the Vite plugin, so here we are!
The bug
On the front-end of a site I have I am seeing DB writes like this:
Going up the stack,
VitePluginService::init()
is the common element, specifically, here:https://github.com/nystudio107/craft-plugin-vite/blob/4ff8dfabd51663fcb081f092eeeba1ed2ed88a50/src/services/VitePluginService.php#L67
This will eventually trigger the DB writes.
Background
The "why" for this is that I am trying to reduce the number of DB writes on the front-end of our sites, as due to the fix for this https://github.com/craftcms/cms/issues/12557 long-ish running db backups can block the front-end if there are writes during the backup.
To reproduce
Expected behaviour
Some mechanism to prevent the Vite plugin asking Craft for a published asset URL when no Vite plugin functionality is used on the front-end of a site. This could be a setting, config variable or potentially moving the relevant code out of
VitePluginService::init()
.Versions