putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
147 stars 35 forks source link

Make position of inject script configurable #636

Closed boboldehampsink closed 3 months ago

boboldehampsink commented 3 months ago

Feature Request

The inject script is now always injected at the end of the body. But when using Turbo Drive for example, and listening to the turbo:load event, this scripts gets added multiple times because the body is re-evaluated - and thus multiple requests are made when browsing around (and keeps getting worse). I'd rather see this script in the head section. Would be nice if it could be configured.

Plugin Version

4.13

bencroker commented 3 months ago

Thanks! Added in https://github.com/putyourlightson/craft-blitz/pull/637 and https://github.com/putyourlightson/craft-blitz/commit/03ae6e52f132e10ab35bc51ed64c2939edfc81df, for the next release.

bencroker commented 3 months ago

Released in 4.14.0.