• Resolved oatwynham

    (@oatwynham)


    Hello w3Total Cache

    I hope you are all keeping well.

    I was caught by a bit of a surprise; AWS billed me $150.00 for invalidations alone; this shook me as I had only just completed new product uploads of 20 products in 1 day, and overnight this arrived. (We are still processing this bill in our minds)

    We wish that you made it clear to your users that the plugin creates invalidations automatically on AWS.

    I have disabled the AWS distribution and the CDN settings on the plugin; however, I want to know a solution? Disable the plugin from creating these invalidations automatically?

    I look forward to your response.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @oatwynham

    I am sorry about the issue you are experiencing with AWS invalidations and I am happy to assist you with this.
    W3 Total Cache can purge the CDN cache by sending invalidation requests or just telling it there are new files to be cached. The CDN will understand what to do with it. The option Only Purge CDN manually is there because of the problems with invalidation requests on CloudFront causing huge bills. If it’s enabled, you can click the purge CDN button in W3 Total Cache to send invalidation requests, otherwise, all changes will be detected automatically and an invalidation request will be sent immediately.

    Cloudflare doesnt charge for “request”, but for invalidation path.
    https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#PayingForInvalidation
    The first 1,000 invalidation paths that you submit per month are free; you pay for each invalidation path over 1,000 in a month. An invalidation path can be for a single file (such as /images/logo.jpg) or for multiple files (such as /images/*). A path that includes the * wildcard counts as one path even if it causes CloudFront to invalidate thousands of files.
    so you can:
    1. invalidate all your images per-case basis,
    i.e.
    https//my-host/wp-content/uploads/2020/01/my-jan-image1.jpg
    https//my-host/wp-content/uploads/2020/01/my-jan-image2.jpg
    https//my-host/wp-content/uploads/2020/02/my-feb-image1.jpg
    that will be charged as 3 paths and thats what w3tc does.
    2. invalidate everything.
    thats what w3tc’s purge all button does. All objects will be removed from cache so your traffic will grow and performance temporarily decline. Also, of course, you have to do it once after multiple posts updated, otherwise if you purge after each change you’ll get a worse situation in the end (3 invalidate-all requests for 3 posts).
    3. invlidate grouped based on knowledge what you’ve modified. in the example below you may invalidate one of:
    3.1 https//my-host/wp-content/uploads/2020/* – one path, will invalidate all 2019 images only
    3.2 https//my-host/wp-content/uploads/2020/01/*, https//my-host/wp-content/uploads/20120/02/* – 2 paths, but will invalidate only all 2020 jan and feb images.
    I hope this helps!
    Thanks!

    Thread Starter oatwynham

    (@oatwynham)

    Hello @vmarko

    Thank you for your response. I want to make sure that if I select the Purge CDN Completely; will this create invalidation paths for all updates and uploads? or 1 path invalidation?

    I look forward to your response?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @oatwynham

    As I’ve stated in the previous post for Purge CDN completely:

    All objects will be removed from cache so your traffic will grow and performance temporarily decline. Also, of course, you have to do it once after multiple posts updated, otherwise, if you purge after each change you’ll get a worse situation in the end (3 invalidate-all requests for 3 posts).

    AWS charges per each file it invalidates.
    so in a case of massive updates, it’s better to switch it off (Enable “Only purge CDN manually”), do those changes, and purge all cdn at once.
    the plugin may not know in advance if changes the user made will be massive or not so it reacts to each action it make.
    Thanks!

    Thread Starter oatwynham

    (@oatwynham)

    Hello @vmarko

    Does this only account for media uploads; or any other theme and plugin updates that could generate invalidations?

    I look forward to your response.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @oatwynham

    The media files are just an example. As I mentioned before Cloudflare doesn’t charge for “request”, but for invalidation path. (please check the article below)
    https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#PayingForInvalidation
    Thanks!

    Thread Starter oatwynham

    (@oatwynham)

    So selectively how would I be able to purge selected files only; and does the w3tc push theme and plugin updates to the CDN and invalidate them?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Purge CDN Completely’ is closed to new replies.