Closed S1SYPHOS closed 4 years ago
@S1SYPHOS sorry to respond so late. feel free to ping me on slack if i ever miss an issue again.
are you on debug mode => true
? then the plugin will not cache anything – but wipe the cache and do not create new caches.
based on you code i doubt that might be happening (since you use the url) but it could also be that you use the same key somewhere else an thus overwrite the result.
the plugin can take care of the key automatically if you want to reduce it to a one-liner.
$data = Lapse::io($page, function () {
$file = F::read(kirby()->root('base') . '/package.json');
$content = json_decode($file, true);
return $content['dependencies'];
}, 5);
another good tip is to add any object you use()
to the keys array as well. then the automatic key will create different caches when the other object changes.
$flag = get('file', 'package');
$data = Lapse::io([$page, $flag], function () use ($flag) {
$file = F::read(kirby()->root('base') . '/'.$flag.'.json');
will check that, thx!
Hey there, as I'd like to use this plugin, I don't seem to be able to make it work as expected. i got the following setup to try caching some results, fetched from my
package.json
:Controller:
Template:
.. but changing version numbers immediately gets shown where I expected a cached version to be delivered. Or maybe I got the concept wrong?
Any pointer in the right direction is highly appreciated.