Closes #6518: inject beacon for saas #6548
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #6518
This PR addresses an issue where the beacon script was not being injected into certain URLs due to the presence of specific query strings. The changes ensure that the beacon script is correctly injected and that the LCP/ATF front-end optimization is correctly applied based on the query strings present in the URL.
Documentation
User documentation
This change will not directly impact users, as it is a backend optimization. However, it will improve the performance of the website by ensuring that the beacon script and LCP/ATF front-end optimization are correctly applied.
Technical documentation
The changes involve the creation of a new method
prepare_critical_image_saas_visit
in theSubscriber
class. This method checks if thewpr_imagedimensions
query string is set and if so, fires an actionrocket_critical_image_saas_visit_buffer
and then calls thespecify_image_dimensions
method. Thestart_image_dimensions_buffer
method has been updated to call this new method instead ofspecify_image_dimensions
.In the
preload_lcp
method, a bail out condition based onrocket_bypass()
has been added to ensure that SaaS visits do not receive the LCP/ATF optimizations.Type of change
New dependencies
N/A
Risks
N/A
Checklists
Feature validation
Documentation
Code style