By bringing content closer to each visitor, CDNs improve performance and reduce load on the origin server - caching is the raison d'etre for CDNs. The reason for this is a CDN's effectiveness can be measured by the cache hit ratio, which is the percentage of requests the CDN was able to serve out of its own cache.
CDNs typically cache static files, such as images, JavaScript files and CSS. This type of content rarely changes and can be heavily cached.
Caches are refreshed based on the caching policies each website defines, which determine the amount of time a given resource remains in the cache.
If the content in the origin server has changed, the new version will be uploaded to the cache.
Purging refers to the active removal of a resource from the cache without waiting for the predetermined cache expiry time.
As soon as a user requests the purged resource, the CDN will cache a copy of the updated content from the origin server.
Once you've decided to purge the cache, the time it takes to execute depends on your CDN. The effectiveness of a purge request is measured in the time it takes for it to propagate worldwide through the entire network.
The speed of the purge depends on several factors, including hardware type, network size and the number of CDN customers requesting cache purges at the same time.
While some CDNs, like Imperva's, can achieve purge times of less than 500 milliseconds, CDNs with larger networks and outdated hardware may take longer to propagate the request and delete the relevant content from all the caching servers.
Most CDNs let you purge a specific resource on demand, but some only give you the option of purging the entire site cache.
Most web developers and website owners want the ability to control their cached content in a manner similar to how they manage their database.
The best way to avoid cache purging is to implement efficient caching policies that reflect the behavior of your website or application.
Manually via the GUI. The Imperva GUI lets you purge the entire cache or a specific resource.
Automated cache purge option using the Imperva API. Using the GUI is simple but it can take a couple of minutes to login and execute the purge.
The API call can be used to purge the entire cache for a site or a specific resource using the resource name as a parameter.
You may want to purge the cache after making adjustments in your site.
To purge the entire cached content for the site, just use the API call with no parameters.
If you want to purge a specific resource, add the resource name in the purge pattern parameter.
Purge pattern - The pattern of the resource to be purged from the cache.
Fast purging allows real-time syncing between the state of the application and the content being served to users from the CDN. It's particularly useful for reacting quickly to business triggers and crisis situations where you can't afford to wait for the cache to refresh automatically.
This Cyber News was published on www.imperva.com. Publication date: Wed, 27 Dec 2023 20:13:05 +0000