Skip to main content
All CollectionsTroubleshootingFeatures and Optimizations
When Does NitroPack Delete Cache Files?
When Does NitroPack Delete Cache Files?
Updated over a year ago

There are quite a few reasons why NitroPack may automatically invalidate your website’s cache based on different actions and the platform used.

To start with, we should first explain the difference between cache Invalidation and cache Purge.

Invalidate only marks the cached content as "stale" but keeps serving it until newly optimized content is available. As a result, your visitors always see optimized content, even though it may be outdated for a short while.

Purge deletes the cached file from your site, meaning your site visitors will immediately see the updated content. However, it won't be optimized for a while until NitroPack prepares the newly optimized content. Usually, this takes between a few seconds to a few minutes.

What cache files does NitroPack store on the hosting server?

NitroPack stores most of the resources of a website on our high-end CDN, but to provide a faster loading time, some of the cache files are stored on the hosting server of the website.

Per page, only two files are stored on the server:

  • The source code of the page (HTML of the page);

  • The critical CSS generated by NitroPack.

image1.png

By default, the files are stored in the following paths for the different platforms:

  • WordPress
    wp-content/nitropack/<random_string>/data/pagecache

  • OpenCart
    public_html/system/storage/cache/nitropackio/data/pagecache

  • Magento
    htdocs/<website>/current/var/nitro_cache/<random_string>/data/pagecache

💡 For convenience, NitroPack stores the different versions of the cache files in separate directories named desktop, mobile, and tablet.

When is the cache invalidated/purged on a WordPress website?

Below, you can find detailed explanations of when the cache is purged or invalidated for the NitroPack plugin on WordPress:

Backend action

Actual operation performed

Message in the NitroPack logs

Navigation menu items are added, modified, or removed.

Invalidation

Invalidation of all pages due to modifying menu entries

Changes are made in WP->Appearance->Customize

Invalidation

Invalidation of all pages due to applying appearance customization

Custom CSS is added in WP->Appearance->Customize->Custom CSS

Invalidation

Invalidation of all pages due to modifying custom CSS

A new post has been scheduled to be published in the future, so the related cache needs to be cleared.

Invalidation

Invalidate related pages due to scheduling [Type] [Title]

A new post has been published.

Invalidation

Invalidate related pages due to publishing [Type] [Title]

An existing post is deleted.

Purge

Invalidate related pages due to deleting [Type] [Title]

Updating a published public post to a private one.

Purge

Invalidate related pages due to making [Type] [Title] private

If none of the above cases. A post is updated. This also clears anything found related to that post.

Invalidation

Updated [Type] [Title]

A comment has changed its status. Statuses include: hold, approve, spam, trash, etc.

Invalidation

Invalidation of [Title] due to changing related comment status

A new approved comment has been posted.

Related WP options:

WP -> Settings -> Discussion -> Comment must be manually approved

WP -> Settings -> Discussion -> Comment author must have a previously approved comment

Invalidation

Invalidation of [Title] due to posting a new approved comment

When downtime mitigation kicks in, all purge requests get added to a backlog file until the service becomes accessible again.

At this point, the integration starts replaying purge requests from the backlog file.

If this process takes too long, the integration deletes the backlog and sends a full purge request for this reason.

Full purge

Full purge after backlog timeout

The website's theme is updated or switched.

Full purge

Theme was switched or updated

When is the cache invalidated/purged on an OpenCart website?

We've taken special care to fine-tune the behavior of the NitroPack extension for OpenCart for different types of events. Here is a detailed explanation of the supported events of every entity:

The document above assumes you are generally familiar with OpenCart, and that you know the differences between Invalidate and Purge.


When is the cache invalidated/purged on a Magento website?

The NitroPack extension for Magento is still in BETA. The purge/invalidate events still need to be documented and will be released alongside the official version of NitroPack for Magento, which is coming out soon.

We've also developed an automatic cache purge for Magento websites. It takes into account all your product attributes and starts a cache optimization upon change. Here's a detailed explanation of the feature:

📌 If you need any assistance or have questions, you can always reach out to our support team at [email protected] or via our live chat.

Did this answer your question?