The issue you're experiencing where Statamic performs a license check with every request instead of hourly could be due to a few potential reasons. Here are some steps to diagnose and resolve the issue:
-
Check Cache Configuration: Ensure that your caching is properly configured. Statamic relies on caching to store the license check results. If caching is not set up correctly, it might be causing the license check to happen more frequently.
-
Verify Cache Driver: Make sure you are using a cache driver that supports persistent storage. For example, using the
filecache driver is a common setup. You can check and set this in your.envfile:CACHE_DRIVER=file -
Check Cache Permissions: Ensure that the cache directory has the correct permissions and is writable by the web server. This is typically the
storage/framework/cachedirectory. -
Review Statamic Configuration: Double-check your Statamic configuration files to ensure there are no settings that might be overriding the default behavior. Specifically, look at
config/statamic/system.phpand ensure there are no custom settings affecting the license check. -
Check for Errors in Logs: Look at your server logs and Statamic logs for any errors that might indicate why the license check is not being cached. Logs can often provide clues about what might be going wrong.
-
Update Statamic: Ensure you are running the latest version of Statamic. There might be bug fixes or improvements related to license checking in newer versions.
Here is a sample of how you might check and set the cache driver in your .env file:
CACHE_DRIVER=file
And ensure your cache configuration in config/cache.php looks something like this:
return [
'default' => env('CACHE_DRIVER', 'file'),
'stores' => [
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
// other cache stores...
],
// other cache settings...
];
By following these steps, you should be able to diagnose and resolve the issue with Statamic performing a license check on every request. If the problem persists, consider reaching out to Statamic support for further assistance.