Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does ZenCache clear the CDN cache? #40

Closed
jaswrks opened this issue Mar 17, 2015 · 6 comments
Closed

Does ZenCache clear the CDN cache? #40

jaswrks opened this issue Mar 17, 2015 · 6 comments

Comments

@jaswrks
Copy link

@jaswrks jaswrks commented Mar 17, 2015


KB Article Creation Checklist
  • Write initial draft for this KB Article; label this issue draft and either questions or tutorials
  • Add required YAML configuration
  • Add Tags for this KB Article to the YAML config (see YAML Keys (Explained))
  • Edit and finalize draft for publishing (remove draft label, add draft-finalized label)
  • Assign Issue to yourself and create Markdown file (remove draft-finalized label, add pending)
  • Project Lead: Review and Publish KB Article (remove pending label, add published label)
Additional TODOs

Additional TODO list items go here.


:octocat: View Markdown File | ✏️ Edit Markdown File
📃 Published KB Article: http://zencache.com/kb-article/does-zencache-clear-the-cdn-cache/


@raamdev

This comment has been minimized.

Copy link
Contributor

@raamdev raamdev commented Mar 18, 2015

(A few more questions that may get asked and should probably be answered as part of this KB Article.)

Where does the ZenCache use of ?iv=1 come into play here? When the cache is cleared manually, does that increment the iv query variable, thereby invalidating the existing cached files on the CDN and resulting in the CDN fetching a fresh copy?

The docs say:

ZenCache will automatically bump an internal counter each time you upgrade a WordPress component (e.g. a plugin, theme, or WP itself). Or, if you ask ZenCache to invalidate the CDN cache (e.g. a manual clearing of the CDN cache); the internal counter is bumped then too. In short, ZenCache handles cache invalidations for you reliably.

That would seem to imply that while clicking "Clear Cache" in ZenCache will not technically "clear the cached data" from the CDN, it will result in the existing cached data no longer being used, i.e., invalidated.

@jaswrks

This comment has been minimized.

Copy link
Author

@jaswrks jaswrks commented Mar 18, 2015

@raamdev writes...

Or, if you ask ZenCache to invalidate the CDN cache (e.g. a manual clearing of the CDN cache); the internal counter is bumped then too.

This is incorrect. I wrote this with the expectation that we would create a "Clear CDN Cache" button of some sort, but this never happened.

The only time the CDN Cache is cleared (i.e., the ?iv being bumped) is when:

  • WordPress is updated.
  • A WP theme is updated.
  • A WP plugin is updated.
  • Your CDN expires the file and fetches a new copy. Most CDNs will be configured to do this based on the Expires: header that your server sends. So for instance, if your server sends an Expires: header for JS/CSS/images, that's how long the CDN will cache it until it fetches it from your server again.
@raamdev

This comment has been minimized.

Copy link
Contributor

@raamdev raamdev commented Mar 18, 2015

This is incorrect. I wrote this with the expectation that we would create a "Clear CDN Cache" button of some sort, but this never happened.

OK, so we need to remove that part of the docs from the Static CDN Filters inline docs during the next update.

Your CDN expires the file and fetches a new copy. Most CDNs will be configured to do this based on the Expires: header that your server sends. So for instance, if your server sends an Expires: header for JS/CSS/images, that's long the CDN will cache it until it fetches it from your server again.

Could you explain that part a bit more? How does ZenCache know that the CDN has expired the file and should therefore increment the iv counter? Or was that miscommunicated and you simply meant that as one of the scenarios in which the CDN cache of a file is cleared? i.e., that's not actually a scenario where iv is incremented; only the latter three scenarios result in ZenCache bumping the iv counter.

@jaswrks

This comment has been minimized.

Copy link
Author

@jaswrks jaswrks commented Mar 18, 2015

@raamdev writes...

Or was that miscommunicated and you simply meant that as one of the scenarios in which the CDN cache of a file is cleared?

Oh yes, sorry. I just meant that the CDN will automatically refresh a particular file whenever it reaches a max age which is based on the original headers that your server sent for the file. There is a more information on this here: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html

@raamdev raamdev changed the title When clearing the cache in the WordPress dashboard, does that also clear the data from the CDN? Does ZenCache clear the CDN cache? Mar 22, 2015
@raamdev

This comment has been minimized.

Copy link
Contributor

@raamdev raamdev commented Mar 22, 2015

Shortened the title to Does ZenCache clear the CDN cache?

@raamdev

This comment has been minimized.

Copy link
Contributor

@raamdev raamdev commented Mar 22, 2015

@raamdev raamdev removed their assignment Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.