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

Handling custom configuration files #95

Open
mvenghaus opened this issue May 9, 2021 · 2 comments
Open

Handling custom configuration files #95

mvenghaus opened this issue May 9, 2021 · 2 comments

Comments

@mvenghaus
Copy link

Hey Vinai,

I have some custom configuration files and I want your tool to handle them without rebuilding the source.

A rules config file would be nice .. maybe something simple like that:
vendor/bin/cache-clean.js -w --custom-rules=rules.json

{
  "/etc/custom\\.xml$": ["config", "block_html"]
}

Or is it already possible?

Regards
Marcus

@Vinai
Copy link
Contributor

Vinai commented May 10, 2021

Hi, thanks for opening the issue!
This is something I've been thinking about, too.
So far I haven't had to cache my custom configuration files, but it certainly is a use case.

My idea was to allow a file called etc/cache-clean-rules.json (or maybe .edn or .js) to be added to modules.
In this file it would be possible to declare three types of mappings:

1.) file name regex to cache types (as in your example)
2.) file name regex to cache IDs
3.) file name regex to a callback that returns the cache IDs to clean for a given file

The underlying idea is to keep cache cleans granular so full config cache cleans can be avoided if possible.
Do you have any thoughts on this?

@mvenghaus
Copy link
Author

Hi,

that sounds like a plan .. I'm in :)

  1. Would be the affected file a parameter in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants