Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Artem Livshits

    (@artemlivshits)

    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.

    Thread Starter Mauricio Macas

    (@getmovil)

    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-326×159.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.

    Thread Starter Mauricio Macas

    (@getmovil)

    Hello, in https://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.

    Plugin Author Artem Livshits

    (@artemlivshits)

    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.

    Thread Starter Mauricio Macas

    (@getmovil)

    Hello, in this site https://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.

    Plugin Author Artem Livshits

    (@artemlivshits)

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

    Thread Starter Mauricio Macas

    (@getmovil)

    Thanks for you great support, best regards.

    Thread Starter Mauricio Macas

    (@getmovil)

    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.

    Plugin Author Artem Livshits

    (@artemlivshits)

    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.

    Plugin Author Artem Livshits

    (@artemlivshits)

    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="https://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="https://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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Compress images in Google Cloud Storage’ is closed to new replies.