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

Update CF APO compatiblity #5974

Merged
merged 11 commits into from Jun 14, 2023
Merged

Update CF APO compatiblity #5974

merged 11 commits into from Jun 14, 2023

Conversation

Tabrisrp
Copy link
Contributor

@Tabrisrp Tabrisrp commented Jun 13, 2023

Description

Use CF plugin class methods directly to manage purge everything and partial purge instead of using their hooks that don't work.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@vmanthos vmanthos self-requested a review June 13, 2023 13:51
@Tabrisrp Tabrisrp added this to the 3.14 milestone Jun 13, 2023
@Tabrisrp Tabrisrp added 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting module: cloudflare type: bug Indicates an unexpected problem or unintended behavior labels Jun 13, 2023
@Tabrisrp Tabrisrp self-assigned this Jun 13, 2023
@vmanthos
Copy link
Contributor

@Tabrisrp I checked cache clearing and currently everything works except for:

  • Clearing a URL's cache after the used CSS has been generated for it
  • Clearing a URL's cache when using the "Clear Used CSS of this URL" admin bar menu item
  • Clearing the cache of date archives
  • With WPML, clearing the cache of a specific language clears the whole cache on Cloudflare. This is happening both when the main language is in its directory, and when it's not
  • Cache Lifespan - we won't be handling this one according to @piotrbak

Can you please look into these? 🙏

@piotrbak
Copy link
Contributor

@vmanthos for the WPML it's okay for the initial release. Lifespan is expected to happen like this.

@Tabrisrp It would be great to fix the first two points, the third one only if we have enough time. The third (an most likely the last alpha would be released today in the afternoon/evening)

@vmanthos
Copy link
Contributor

@piotrbak For WPML, @Mai-Saad reminded me of issue #5590. That's likely the reason for what I reported and it's not specific to this PR.

@piotrbak
Copy link
Contributor

@vmanthos Well, looks like we are synced with cache then ;)

@Tabrisrp
Copy link
Contributor Author

I added purge after used CSS generation and clean.

The CF plugin doesn't have a public method to clean cache based on an URL value, only from post ID, so anything that is not a post type is not going to be cleaned currently. Maybe we can create an issue on their repo so they add a public method for that?

@Tabrisrp Tabrisrp marked this pull request as ready for review June 14, 2023 13:22
@Tabrisrp Tabrisrp requested a review from a team June 14, 2023 13:22
Copy link
Contributor

@vmanthos vmanthos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes, @Tabrisrp! 🙏

The cache is cleared in both cases related to Remove Unused CSS.

We are good to go with this. 👍

NOTE

When WPML was enabled, clearing the used CSS for a URL wasn't clearing the cache on Cloudflare APO while our cache was cleared.

This requires further investigation.

@Tabrisrp Tabrisrp added this pull request to the merge queue Jun 14, 2023
Merged via the queue into develop with commit 82e2347 Jun 14, 2023
7 checks passed
@Tabrisrp Tabrisrp deleted the fix/cf-apo-clear branch June 14, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting module: cloudflare type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants