PhileCMS / Phile

A flat file CMS with a swappable parser and template engine.
https://philecms.github.io/
Other
255 stars 48 forks source link

[FEATURE] Don't use file cache out of the box #327

Closed Schlaefer closed 6 years ago

Schlaefer commented 6 years ago

Out of the box the file-cache is active. This is great for production, but rather irritating when you just discovered Phile. You download and install Phile, you see it running in the browser, you maybe change the root content/index.md to to tinker around and discover how it works … and nothing happens, because the site is cached now.

The discoverability for that behavior is rather low. Imho the cache should be off by default with easy to spot hints how to activate it.

kicken commented 6 years ago

Maybe the configuration for the cache plugin could be moved from the defaults.php over to the config.php file. The current demo plugin configuration could be replaced with a real configuration for the cache plugin as an example. Perhaps something such as:

/**
 * cache engine - Cache rendered markdown pages to improve response times.
 *
 * To enable this plugin, set it's active flag to true.
 * For more information about plugins, see https://github.com/PhileCMS/Phile/wiki/%5BCOMMUNITY%5D-Plugins
 */
$config['plugins']['phile\\phpFastCache'] = ['active' => false];

Should be easy to spot and understand when users edit their config file and provides a link to additional plugin information for the curious.

Schlaefer commented 6 years ago

Another option is using a non-persistent cache per default. This would also solve the inconsistency that every service is supposed to be available except the cache, which always requires to check for availability ala 1/2.

The cache service would be always available, but to "really" activate it one would switch to a persistent driver (e.g. files). We could use either phpFastCache's memstatic (store in memory during request) or devnull (cache nothing) driver.

Schlaefer commented 6 years ago

Closed in favor of pull request #329