Skip to content

Instantly share code, notes, and snippets.

@jpedro
Forked from mattstauffer/blog.md
Created March 5, 2020 18:44
Show Gist options
  • Save jpedro/65026cd23e14240a2c90b011c439359e to your computer and use it in GitHub Desktop.
Save jpedro/65026cd23e14240a2c90b011c439359e 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'.
@jpedro
Copy link
Author

jpedro commented Mar 5, 2020

Testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment