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

Closes #6518: inject beacon for saas #6548

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Apr 9, 2024

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 the Subscriber class. This method checks if the wpr_imagedimensions query string is set and if so, fires an action rocket_critical_image_saas_visit_buffer and then calls the specify_image_dimensions method. The start_image_dimensions_buffer method has been updated to call this new method instead of specify_image_dimensions.

In the preload_lcp method, a bail out condition based on rocket_bypass() has been added to ensure that SaaS visits do not receive the LCP/ATF optimizations.

Type of change

  • Enhancement (non-breaking change which improves an existing functionality).

New dependencies

N/A

Risks

N/A

Checklists

Feature validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.

Documentation

  • I prepared the user documentation for the feature/enhancement and shared it in the PR or the GitHub issue.
  • I prepared the technical documentation if needed, and shared it in the PR or the GitHub issue.

Code style

  • I wrote self-explanatory code about what it does.
  • I wrote comments to explain why it does it.
  • I named variables and functions explicitly.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • I listed the introduced external dependencies explicitly on the PR.
  • I validated the repo-specific guidelines from CONTRIBUTING.md.

@Miraeld Miraeld added the type: enhancement Improvements that slightly enhance existing functionality and are fast to implement label Apr 9, 2024
@Miraeld Miraeld added this to the 3.16 milestone Apr 9, 2024
@Miraeld Miraeld self-assigned this Apr 9, 2024
@Miraeld Miraeld changed the base branch from develop to feature/lcp-above-the-fold-optimization April 9, 2024 03:34
@Miraeld Miraeld requested a review from a team April 9, 2024 03:35
@Miraeld Miraeld force-pushed the enhancement/6518-inject-beacon-for-saas branch from 471ad6d to 7ba2267 Compare April 9, 2024 03:56
@Miraeld Miraeld changed the title Enhancement/6518 inject beacon for saas Closes #6518: inject beacon for saas Apr 9, 2024
@Miraeld Miraeld force-pushed the enhancement/6518-inject-beacon-for-saas branch from 7ba2267 to aec0c3d Compare April 9, 2024 16:25
@Miraeld Miraeld requested a review from remyperona April 11, 2024 01:53
@MathieuLamiot MathieuLamiot merged commit e31b05b into feature/lcp-above-the-fold-optimization Apr 12, 2024
9 checks passed
@MathieuLamiot MathieuLamiot deleted the enhancement/6518-inject-beacon-for-saas branch April 12, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.16 bug - Beacon is not injected on URLs visited by the SaaS
3 participants