Skip to content

Instantly share code, notes, and snippets.

@mattstauffer
Last active March 5, 2020 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattstauffer/9d10e92a0f2b14c66ad5 to your computer and use it in GitHub Desktop.
Save mattstauffer/9d10e92a0f2b14c66ad5 to your computer and use it in GitHub Desktop.
Serving Statamic data from in-memory cache

Ed Finkler (Funkatron) asked me, in response to my recent article introducing Statamic, whether you could change Statamic's settings to serve from something other than the local disk.

I checked with Jason & Jack at Statamic, and they told me three things:

  1. Statamic already has the ability (if configured a certain way) to compile all the files down to HTML. It's possible (I don't know how yet, but I know it is) to configure Nginx to serve those files directly.
  2. Statamic v1 has a static site generator built-in, and v2 will get one soon.
  3. Since Statamic's .env file effects the behavior of its Laravel core, you can change the cache driver that your Statamic app is using just like you would in any Laravel app. Just add a CACHE_DRIVER key in .env file and set it to any of the options: 'file', the default; 'database'; 'memcached'; 'redis'; 'apc'; or 'array'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment