DEV Community

Discussion on: Is writing to JSON an acceptable cache

Collapse
 
rhymes profile image
rhymes

You can also use the disk if you don't want to setup Redis and if you have access to the file system.

A cache is a cache. There are advantages and disadvantages on each cache but you can totally start with a json file on disk and then move on something more scalable if you need to.

The principle is the same, replace Redis with the file. Keep in mind that you need to cleanup the cache manually at some point, though one file per day isn't too much