wp-media / wp-rocket

Performance optimization plugin for WordPress
https://wp-rocket.me
GNU General Public License v2.0
699 stars 218 forks source link

3.18 - CDN compatibility part #7064

Open piotrbak opened 3 weeks ago

piotrbak commented 3 weeks ago

User Story As a user with the CDN option, I want locally stored Google Fonts and CSS files to be loaded from the CDN

Acceptance Criteria

  1. The feature will rewrite paths to the CSS files to the CDN paths
  2. The feature will rewrite paths to the fonts to the CDN paths
  3. The feature will rewrite paths to the fonts to the CDN paths when the CSS method will be set to be internal one with the filter
jeawhanlee commented 1 week ago

Scope a solution ✅

The feature will rewrite paths to the CSS files to the CDN paths

Estimate the effort ✅ [XS]

Miraeld commented 1 week ago

Looks good to me.

remyperona commented 1 week ago

A simple solution to handle the CDN rewrite in the CSS path without having to have the CDN class as a dependency is to use a filter on the URL, and add a hook on it in the CDN Subscriber