WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] How to exclude some pages from CDN/Caching (9 posts)

  1. hlwinkler
    Member
    Posted 1 year ago #

    Hello,

    I am using W3TC (happily installed the hotfix this morning) and I have one issue, which is that I want to turn on https on my checkout page but I always get mixed ssl warnings because of images and css/js being loaded with http from MaxCDN. I would actually like to entirely exclude my checkout area from being handled by W3TC at all. Is this possible, or alternately is it at least possible to have certain pages not make use of the CDN? I'd prefer not to also set up my cert with MaxCDN because it adds complexity to my admin task and incurs another yearly cost (and I'm also not sure that the certificate I purchased will work with other domain suffixes).

    I accidentally also asked this here outside of this subforum, please feel free to delete my earlier post: http://wordpress.org/support/topic/plugin-w3-total-cache-how-to-exclude-some-pages-from-cdncaching

    Thank you for any assistance!

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

  2. hlwinkler
    Member
    Posted 1 year ago #

    Any way to do this?

  3. hlwinkler
    Member
    Posted 1 year ago #

    Would it be possible for the developer or someone else in the know to confirm that this is or isn't possible?

  4. hlwinkler
    Member
    Posted 1 year ago #

    OK, I guess not. I did my own digging and there is an array in wp-content/plugins/w3-total-cache/lib/W3/Plugin/Cdn.php called auto_reject_uri:

    $auto_reject_uri = array(
    'wp-login',
    'wp-register'
    );

    it looks for strings in the URL rather than a fixed path to a resource. So, for example, in my case I can prevent my WooCommerce cart/checkout/account paths from using CDN by adding the following to it:

    $auto_reject_uri = array(
    'wp-login',
    'wp-register',
    'checkout',
    'cart',
    'my-account'
    );

    There doesn't seem to be any kind of input anywhere which will add items to this array and the excluded files list doesn't work for URLs, so it would be really great to have this as an enhancement.

  5. jumbo
    Member
    Posted 1 year ago #

    A couple thoughts:

    On the "Page Cache" settings page, there's an option to "Cache SSL (https) requests" which can be turned off.

    Further down on that page is an option to "Never cache the following pages:", which you can enter and save. This way you can avoid hacking the core, which is just going to get overridden when you upgrade.

  6. hlwinkler
    Member
    Posted 1 year ago #

    Hi,

    Thanks for the suggestion. I don't think page caching is related to the CDN functionality. The first thing I tried was adding the pages to the "never cache" list but it had no effect. I'm aware that I'll need to hack in this patch with every upgrade.

  7. Cristian Tala S.
    Member
    Posted 1 year ago #

    hlwinkler,

    I had the same trouble. You fixed it adding the pages to the array right ?

  8. hlwinkler
    Member
    Posted 1 year ago #

    Yup, it worked like a charm and is saving me $39 a month in CDN dedicated SSL costs. It would be a great feature for Frederick to add in a future update so it isn't necessary to hack in after every update.

  9. Cristian Tala S.
    Member
    Posted 1 year ago #

    Thanks for the reply. I did the same and it works like a charm.

    By the way, I wanted to do it for WooCommerce too :).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic