Reputation: 239
I am looking way to offload JS and CSS of WordPress to the GCP CDN bucket so I can serve them via CDN.
I am minifying JS and CSS using the plugin so looking for a way if any existing plugin available in WordPress which can sync or upload CSS & JS files to the GCP cloud storage bucket.
Upvotes: 0
Views: 809
Reputation: 2468
You could check WP-Stateless plugin This plugin copies files from your WordPress site to Google Cloud Storage automatically as they are uploaded to the media library. It then offers different modes, such as backing up a copy of your media or even deleting the media from WordPress and serving up from Google Cloud Storage or a CDN.
Also, I have found a good guide that can help you with your task
WordPress Google Cloud Storage – How to Offload Your Media
You can choose manually the file type you need:
Field description: Define the file types you would like supported. Separate each type by a space.
This field should also be supported by a wp-config constant (WP_STATELESS_MEDIA_BODY_REWRITE_TYPES)
define('WP_STATELESS_MEDIA_BODY_REWRITE_TYPES', 'jpg jpeg png gif pdf');
Another option for integrating Google Cloud Storage with your WordPress site is to use the equally awesome free WP Offload Media Lite plugin (or premium WP Offload Media) from Delicious Brains Inc.
This plugin automatically copies images, videos, documents, and any other media added through WordPress’ media uploader to Google Cloud Storage.
This plugin uploads the files to your server first, then copied to the bucket, and then you need to remove it from your server, according with the official documentation, there is an option to automatically remove the files from your server once they are copied to the bucket.
Additionally, you could find a good guide in this link: How to Set Up a Custom Domain CDN for Google Cloud Storage
Upvotes: 1