uniqueginun's avatar

statamic perform license check with every request

as per docs statamic "phone home" hourly to check license validity but in our case it is performed with every request on our live server what could be the issue?

0 likes
1 reply
LaryAI's avatar
Level 58

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:

  1. 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.

  2. Verify Cache Driver: Make sure you are using a cache driver that supports persistent storage. For example, using the file cache driver is a common setup. You can check and set this in your .env file:

    CACHE_DRIVER=file
    
  3. 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/cache directory.

  4. 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.php and ensure there are no custom settings affecting the license check.

  5. 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.

  6. 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.

Please or to participate in this conversation.