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

Extend offline browsing runtime caching to include assets in wp-content that in a plugin/theme directory #953

Open
westonruter opened this issue Mar 24, 2023 · 0 comments

Comments

@westonruter
Copy link
Collaborator

Offline browsing currently enables runtime caching for:

Category Class Pattern
Uploaded images WP_Service_Worker_Uploaded_Image_Caching_Component image file extensions in wp-content/uploads
Core assets WP_Service_Worker_Core_Asset_Caching_Component '^' . preg_quote( trailingslashit( includes_url() ), '/' ) . '.*'
Plugin assets WP_Service_Worker_Plugin_Asset_Caching_Component '^' . preg_quote( trailingslashit( plugins_url() ), '/' ) . '.*'
Theme assets WP_Service_Worker_Theme_Asset_Caching_Component '^(' . implode( '|', $theme_directory_uri_patterns ) . ').*'

Nevertheless, what is not currently accounted for in runtime caching are assets located in wp-content that aren't inside of uploads, themes, or plugins. Namely, as noted in #667 (comment), a caching plugin like Autoptimize will generate scripts and styles that get stored in wp-content/cache. These should be included in the runtime cache when offline browsing is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant