---
title: Minit Update: Better Cache Purge and a Filter to Exclude Files
date: 2014-02-13T11:56:25+00:00
modified: 2014-02-13T11:56:25+00:00
permalink: https://kaspars.net/blog/minit-cache-purge-exclude-files-filter
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
post_tag:
  - Plugin
  - Snippet
category:
  - WordPress
---

# Minit Update: Better Cache Purge and a Filter to Exclude Files

I have updated the [Minit plugin](https://github.com/kasparsd/minit) to include the following improvements:

**Purging cache will no longer delete files in the Minit cache folder.** Instead, it will bump a global version number that is used when generating Minit cache keys. This will ensure that users don’t get 404 errors on heavily cached sites for files that haven’t been regenerated yet. Cache files can still be deleted by calling `do_action( 'minit-cache-purge-delete' );` from cron, for example.

**Ability to exclude files from being concatenated** using a filter:

```
add_filter( 'minit-exclude-js', 'exclude_my_file' );
add_filter( 'minit-exclude-css', 'exclude_my_file' );

function exclude_my_file( $exclude ) {
	// ID of the script that was enqueued
	$exclude[] = 'admin-bar';

	return $exclude;
}
```