Forum Replies Created

Viewing 1 replies (of 1 total)
  • I had a similar experience as the others described and I’ve learned why this happening. For those of you confused about the surprising AWS bills allow me to clarify, and please correct me if I’m wrong.

    W3TC is like a doorway to your AWS account specifically the Cloudfront service. You can think of the billing system for Cloudfront as a machine that copies and counts all of the files in your /wp-content/cache/object folder when you first deploy to it.

    Then it distributes a copy of those static files aka objects to its global network of datacenters. As of posting this, the free tier comes with 2,000,000 requests per month.

    https://aws.amazon.com/cloudfront/pricing/

    If you open up chrome inspector’s Network tab on your website’s homepage, you can see the total number of http requests made in the lower left corner. So each time you or someone else comes along and visits your homepage that’s how many requests they are making to your account, then their browser will hopefully cache all known files from there until they expire. As the visitor continues to navigate around your website each new http request they make such as an image will also be counted. Even though the total number of http requests is multiplied per unique visitor, the high cost probably isn’t happening because of that, its more likely to come in the form of invalidation requests.

    After the Cloudfront is setup and deployed any changes to your css, js, images or fonts (to name a few) will be flagged as “invalid” meaning a new version of that file is available for Cloudfront to redistribute.

    Here’s where the expensive bills are likely coming from.

    Every time you purge the CND cache you are telling W3TC to signal Cloudfront that each path specified is invalid and that a request should be made.

    Path. Not file.

    The free tier only comes with 1,000 invalidation paths.

    The following counts as 3 paths.
    images/apples.jpg
    images/cat.png
    images/something.jpg

    Using a wildcard it counts as 1 path.
    images/*

    Things that WILL cause invalidation requests:
    – Pressing the “purge CDN completely” button inside of W3TC.
    – Purging files manually.

    Things that MAY cause invalidation requests (if CDN pulls):
    – Creating or updating public files.
    – Updating plugins. (css, js, fonts, img)
    – Updating core.
    – htaccess cache expiration timers?

    • This reply was modified 5 years, 11 months ago by gjones604.
Viewing 1 replies (of 1 total)