mapbox/millstone — Issue #30: framework for different caching strategies
Author: springmeyer
Created: 2011-11-16 03:55:13+00:00
State: open

Driven by https://github.com/mapbox/tilemill/issues/922 we should think about how to make the caching (and cache flushing) functionality more modular.

So far for the experimentation in the 'live-cache' branch of tilemill this is all that is needed to trigger rec-caching upon save, but we can do better:

```diff
diff --git a/lib/millstone.js b/lib/millstone.js
index ef4beb0..fdd70b5 100644
--- a/lib/millstone.js
+++ b/lib/millstone.js
@@ -312,7 +312,7 @@ function resolve(options, callback) {
if (uri.protocol) {
var filepath = path.join(cache, cachepath(l.Datasource.file));
path.exists(filepath, function(exists) {
- if (exists) {
+ if (exists && !(l.cache_method && l.cache_method === 'live')) {
symlink(filepath);
} else {
utils.mkdirP(path.dirname(filepath), 0755, function(err) {
```