Forums

W3 Total Cache
Not automatically uploading all thumbnails to CDN (9 posts)

  1. mikeaag
    Member
    Posted 3 months ago #

    Im using a self hosted CDN with w3 total cache.

    it can upload fine, and the site references the files correctly as well.

    However, it doesnt seem to be automatically uploading all of the thumbnail sizes i have.

    Im also using WP E-Commerce, and this is mainly where the problem is. If i add a new product (or edit an existing one), and then add an image to that product, the full size image is added to the cdn, along with various other thumbnail sizes, however, it seems to miss off the key thumbnail sizes i use within my theme.

    The extra thumbnail images are on my main domain, just not in the cdn.

    Is there a way to make w3 total cache upload all the thumbnail files when are post is saved (particularly if a product is saved)

    I hope this makes sense, if not feel free to ask me any questions.

    Thanks in advance,

    Mike

    WordPress Version: 3.3.1
    W3 Total Cache Version: 0.9.2.4

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 3 months ago #

    In the custom files field on the CDN settings tab you can specify the path to the thumbnails and specify some kind of pattern to match those files that are missing; e.g.:

    wp-content/uploads/*-thumb.jpg for example

  3. mikeaag
    Member
    Posted 3 months ago #

    Hi Frederick,

    Thanks for the reply.

    in my custom files field i already have "wp-content/uploads/*", but this only seems to help if i manually press the button to upload the custom files.

    If i put in the pattern for the extra thumbnails, for example "wp-content/uploads/*-62x62.jpg", will this mean that when i save a post, these additional files are uploaded automatically to the CDN?

    Am i missing something here? because it doesn't seem to be working?

    Would it be possible to manually code this? Im still pretty new to wordpress coding, but would it be possible to add some code so that when any page/post (regardless of post type) is saved, it checks all related thumbnails, and then makes sure they exist on the CDN?

    Any information you can give me on this would be greatly appreciated.

    Thanks again
    Mike

  4. mikeaag
    Member
    Posted 3 months ago #

    Just in case anyone has a similar problem to me, ive found a work around solution.

    I've set W3TC to upload changed files every hour, and set "wp-content/upload/*" in my custom files list.

    This however means that some of the thumbnails are still not displaying for anywhere up to an hour.

    So to solve this, add this to your .htaccess files on your cdn domain

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} \.(jpg|gif|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . http://www.mydomain.co.uk/%{REQUEST_URI} [L]
    </IfModule>

    This basically redirects any request for an image that doesn't exist back to your main domain.

    This has worked for me, but if your using a different set up, you may need to tweak it.

    I would still like to know how i can make it automatically and instantly upload like the rest of the thumbnails though, so i would be grateful for any information

    Thanks,

    Mike

  5. Frederick Townes
    Member
    Posted 3 months ago #

    Have you enabled the auto-upload option?

  6. mikeaag
    Member
    Posted 3 months ago #

    Hi Frederick,

    I have it sent to auto upload changed files every hour.

    And every hour, the missing thumbnails are uploaded. Im looking for a way to get all the thumbnails uploaded when they are created.

    Also, It seems that the .htaccess file on my CDN is being overwritten by a default file.

    This is causing my temp fix to stop working (as it gets rid of my file).

    Is there a way to stop the .htaccess file from uploading to the cdn and overwriting my temp fix?

    Thanks,

    Mike

  7. Frederick Townes
    Member
    Posted 2 months ago #

    Unfortunately there's no instant way to have them uploaded except switching to an origin pull CDN.

  8. mikeaag
    Member
    Posted 2 months ago #

    Hi Frederick,

    Thanks for getting back to me.

    Im not too familiar with CDN technology, so i guess i'll have to find a way to make this work for me.

    Thanks again for your help on this

    Mike

  9. Frederick Townes
    Member
    Posted 2 months ago #

    MaxCDN or CloudFront by Amazon are support and remove this challenge of "syncing" from your site because the CDN does the work for you.

Reply

You must log in to post.

About this Plugin

About this Topic