When we are using wordpress autoptimize plugin, we may get this error: Autoptimize cannot write to the cache directory (wp-content/cache/autoptimize/). In this tutorial, we will introduce you how to fix it.
Step 1: Check cache/autoptimize permission
You can read this tutorial to update cache folder permission to fix this error.
However, if you have changed the permission, this error also exists, you can read step 2.
Step 2: Check the autoptimize last modified time
Sometimes, there exists an autoptimize folder, this folder may created by other version Autoptimize plugin. For example:
We can delete or rename this file, Autoptimize plugin will create a new one.
Finally, you will find this error is fixed.