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

Enhance the way we detect the cached page for lcp beacon script #6637

Closed
1 of 4 tasks
wordpressfan opened this issue May 17, 2024 · 4 comments
Closed
1 of 4 tasks

Enhance the way we detect the cached page for lcp beacon script #6637

wordpressfan opened this issue May 17, 2024 · 4 comments
Labels
module: OCI Optimize Critical Images needs: product direction priority: low Issues that can wait quick win type: enhancement Improvements that slightly enhance existing functionality and are fast to implement

Comments

@wordpressfan
Copy link
Contributor

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version Yes
  • Used the search feature to ensure that the bug hasn’t been reported before Yes

Describe the bug
Based on this PR: #6610

We agreed to merge it as it is and open another issue to mention the cases we need to handle to enhance this PR's code.

  • We can see in some cases we don't serve cache files mainly as a compatibility with some hosting companies so the cache is served from the hosting company not from our side, for this case we may consider clearing the page cache for the page that its lcp row was updated/created.
  • When the constant WP_ROCKET_WHITE_LABEL_FOOTPRINT is there we still add the Debug: cached here and we search for it in the new beacon here So we are fine here
  • @MathieuLamiot suggested to use the following strings instead of Debug: cached :
'<!-- Optimized for great performance'
OR
'<!-- This website is like a Rocket, isn't it? Performance optimized by '
  • Another suggestion is to add a class name or data attribute to any element (html, body, ...etc.) inside the cache file and use it, but again this will work only when we serve our cache (Check first point)

Additional context
Add any other context about the problem here.

Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming

@wordpressfan wordpressfan added the type: enhancement Improvements that slightly enhance existing functionality and are fast to implement label May 17, 2024
@MathieuLamiot
Copy link
Contributor

@jeawhanlee mentioned here that sometimes Debug: cache is not present. This is why I suggested instead:

 '<!-- Optimized for great performance'
OR
'<!-- This website is like a Rocket, isn't it? Performance optimized by '

I don't know in which case this happens though. Maybe @jeawhanlee can explain? But there is a condition so I guess it can happen that Debug: cached is not there:

if ( ! empty( $time ) ) {
     $footprint .= ' - Debug: cached@' . $time;
}

@piotrbak piotrbak added the lcp label Jun 5, 2024
@piotrbak piotrbak added the priority: low Issues that can wait label Jul 1, 2024
@piotrbak piotrbak added module: OCI Optimize Critical Images quick win and removed lcp labels Jul 15, 2024
@piotrbak piotrbak added this to the 3.16.3 milestone Jul 16, 2024
@piotrbak piotrbak added noQA and removed noQA labels Jul 18, 2024
@remyperona
Copy link
Contributor

What are the expectations and acceptance criterias for this issue?

@MathieuLamiot
Copy link
Contributor

@wp-media/product I think this issue would benefit clear use-cases and ACs as I see it is planned for 3.16.4

@piotrbak
Copy link
Contributor

piotrbak commented Aug 5, 2024

@MathieuLamiot while looking into this issue it doesn't seem to be a quick win. I thought we're not covering the whitelabel scenario but it's the case already. I don't think we'll have an easy solution here to cover the 3rd-party cache.

@piotrbak piotrbak removed this from the 3.16.4 milestone Aug 5, 2024
@piotrbak piotrbak closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: OCI Optimize Critical Images needs: product direction priority: low Issues that can wait quick win type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

No branches or pull requests

4 participants