WordPress.org

Ready to get started?Download WordPress

Forums

WP2Cloud
Compress images in Google Cloud Storage (11 posts)

  1. Mauricio Macas
    Member
    Posted 9 months ago #

    According to the recommendations of page speed, how i can compress images to upload in my account in google cloud storage to server fast to my wordpress blog?

    Thanks for you support.

    Please see: http://stackoverflow.com/questions/19234871/compress-images-in-google-cloud-storage

    http://wordpress.org/plugins/wp2cloud-wordpress-to-cloud/

  2. Artem Livshits
    Member
    Plugin Author

    Posted 9 months ago #

    From the stackoverflow answer, it looks like you're looking for the max-age header setting. The max-age header is set to expire in 1 year, so this should ensure the optimal caching behavior.

  3. Mauricio Macas
    Member
    Posted 9 months ago #

    Hello, thanks for you support, but i don´t looking max-age header, just need to compress the images to reduce the size of the images in Google Cloud Storage, because Google PageSpeed recommend me ​that i compress the images for my blog load faster, for example:

    Losslessly compressing https://commondatastorage.googleapis.com/bucket_name/19725A38D6BD56/1CC/5154/8oZH9T8bx1QFDwQwzH8b-svjm_1QQGyz64bhGhBWfYw/android-xperia-z1-smartphones-android-326x159.jpg could save 955B (15% reduction).

    The WP2Cloud Plugin is incompatible with other plugins like EWWW Image Optimizer and WP Smush.it, because this plugin upload directly uncompressed images from the WordPress editor to Cloud Storage, the metadata of images in Cloud Storage are fine as expiration cache, gzip encoding, etc, just need to compress the images that are uploaded with WP2Cloud plugin to Cloud Storage.

    Must i edit the bucket in Cloud Storage to compress the images, or Google Cloud Storage does not compress and reduce the size of the images?

    Thanks for you support.

  4. Mauricio Macas
    Member
    Posted 9 months ago #

    Hello, in http://stackoverflow.com/questions/19234871/compress-images-in-google-cloud-storage recommend:

    Dear friend above command will compress images, or any static files like css, js etc. I am using this for my client, couldn't mention here live example. I found reduction in images 10 to 40% and js or css more than 50%. You can use this gsutil tool from any desktop no need for server. One addition: just add must-revalidate in above command Cache-Control:public, max-age=604800, must-revalidate

    Any solution?

    Thanks for you support.

  5. Artem Livshits
    Member
    Plugin Author

    Posted 9 months ago #

    I see.

    We checked WP Smush.it a while ago and at the time it seemed like it was too much work to integrate with it. WP2Cloud came a long way since then (we added integration hooks and etc.), so we plan to re-evaluate the integration possibility. We'll check EWWW Image Optimizer too.

  6. Mauricio Macas
    Member
    Posted 9 months ago #

    Hello, in this site http://stackoverflow.com/questions/5451597/how-does-googles-page-speed-lossless-image-compression-work, show the techniques used by PageSpeed ​​to reduce and compress the size of the images, could be added in WP2Cloud plugin?

    Thanks for you great support.

  7. Artem Livshits
    Member
    Plugin Author

    Posted 9 months ago #

    I think we'll start with smush.it integration and then look into PageSpeed.

  8. Mauricio Macas
    Member
    Posted 9 months ago #

    Thanks for you great support, best regards.

  9. Mauricio Macas
    Member
    Posted 9 months ago #

    Hello, a recommendation, it would be nice that WP2Cloud Plugin could upload static content as css and js to google cloud storage or amazon cloud. Best Regards.

  10. Artem Livshits
    Member
    Plugin Author

    Posted 9 months ago #

    To upload static content to cloud storage for caching and distribution, you can use W3 Total Cache plugin. It works well with WP2Cloud and provides a bunch of functionality for speeding up the website.

  11. Artem Livshits
    Member
    Plugin Author

    Posted 9 months ago #

    We looked into integration with wp-smush.it and EWWW Image Optimizer and here is what we found.

    EWWW Image Optimizer
    Version 1.7 incorporated a fix that was needed to make it work during image upload. So the latest version of EWWW Image Optimizer can do optimization / conversion during image upload.

    wp-smush.it
    Here is a patch that would make wp-smush.it 1.6.5.4 work with WP2Cloud 1.3.10:

    --- a/wordpress/wp-content/plugins/wp-smushit/wp-smushit.php
    +++ b/wordpress/wp-content/plugins/wp-smushit/wp-smushit.php
    @@ -348,7 +348,7 @@ class WpSmushit {
    
     		// check that the file exists
     		if ( !file_exists( $file_path ) || !is_file( $file_path ) ) {
    -			return sprintf( __( "ERROR: Could not find <span class='code'>%s</span>", WP_SMUSHIT_DOMAIN ), $file_path );
    +			// return sprintf( __( "ERROR: Could not find <span class='code'>%s</span>", WP_SMUSHIT_DOMAIN ), $file_path );
     		}
    
     		// check that the file is writable
    @@ -356,9 +356,18 @@ class WpSmushit {
     			return sprintf( __("ERROR: <span class='code'>%s</span> is not writable", WP_SMUSHIT_DOMAIN ), dirname($file_path) );
     		}
    
    -		$file_size = filesize( $file_path );
    -		if ( $file_size > WP_SMUSHIT_MAX_BYTES ) {
    -			return sprintf(__('ERROR: <span style="color:#FF0000;">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href="http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict">FAQ</a></span>', WP_SMUSHIT_DOMAIN), $this->format_bytes($file_size));
    +		if ( file_exists( $file_path ) && filesize( $file_path ) > WP_SMUSHIT_MAX_BYTES ) {
    +			return sprintf(__('ERROR: <span style="color:#FF0000;">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href="http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict">FAQ</a></span>', WP_SMUSHIT_DOMAIN), $this->format_bytes(filesize( $file_path )));
    +		}
    +
    +		$cloud_file = apply_filters( 'wp2cloud_get_file_url', $file_path );
    +
    +		if ( $cloud_file != $file_path ) {
    +			$file_url = $cloud_file;
    +		}
    +
    +		if ( strpos( $file_url, '//' ) === false ) {
    +			$file_url = get_option( 'home' ) . $file_url;  // fix root relative URLs
     		}
    
     // local file check disabled 2013-09-05 - I don't see a point in checking this. We only use the URL of the file to Yahoo! and there is no gaurentee

    Also the Enforce image URL is same as Home option (Settings --> Media) should be unchecked.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.