• So, after setting up cloudfront CDN on W3 Total cache, overnight the plug used 99 million invalidations in 24hrs which ran up a bill of over $500. My site only has 45 posts !

    $0.000 per URL – first 1,000 URLs / month.1,000.000 URL$0.00
    $0.005 per URL – over 1,000 URLs / month.99,919.000 URL$499.60

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

    (@vmarko)

    Hello @humpinghummer

    Thank you for your review and I am sorry about the issue you are experiencing with CF invalidations.
    Cloudflare doesn’t 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:
    invalidate all your images per-case basis,
    i.e.
    https//my-host/wp-content/uploads/2019/01/my-jan-image1.jpg
    https//my-host/wp-content/uploads/2019/01/my-jan-image2.jpg
    https//my-host/wp-content/uploads/2019/02/my-feb-image1.jpg
    that will be charged as 3 paths and that’s what w3tc does.
    2. invalidate everything.
    that’s 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 the worse situation in the end (3 invalidate-all requests for 3 posts).
    3. invalidate grouped based on knowing what you’ve modified. in the example below, you may invalidate one of:
    3.1 https//my-host/wp-content/uploads/2019/* – one path, will invalidate all 2019 images only
    3.2 https//my-host/wp-content/uploads/2019/01/*, https//my-host/wp-content/uploads/2019/02/* – 2 paths, but will invalidate only all 2019 jan and feb images.
    Can you please share what settings you have enabled in Peformance>CDN. there is an option “Only Purge CDN manually” in the advanced section. Is that option enabled?
    Thank you!

    Thread Starter humpinghummer

    (@humpinghummer)

    Hi,

    Thankfully amazon came though and refunded the charge as they could see it was not a normal amount of traffic for my account 😉

    I had Only Purge CDN manually un-ticked.
    However I think the plugin should have some form of protection from this happening, some sort of throttle or alert.

    I think it might have happened becuase I upgraded the WP template and it re generated the thumbnails, but 100m is still way of the scale.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Massive Cloudfront Charges’ is closed to new replies.