Asset cache folder location
  • I have the same codebase on a server in production and development environments.

    I moved recent dev code to production OK, but the asset cache couldn't be used in the same way it was on dev. Usually, the production & dev code uses the "combine" asset setting. But on production the cache files for js and css were not being written.

    I upped the log level and found this:

    ERROR - 2017-01-15 10:30:36 --> Severity: Warning --> opendir(/home/xxx/public_html/assets/cache/cache/): failed to open dir: No such file or directory ...


    So I commented out the cache key in

    $config['assets_folders'] = array(
    ...
    ...
    'cache' => 'cache/' // removed
    );

    and then the asset cache files were able to be generated again in /assets/cache. But I feel uneasy that this doesn't really address the problem, and that this may bite me later.

    Why would the cache folder be (incorrectly) nested as per the opendir log entry?

  • In other environments however, removing the cache key from assets_folders results in the cache file being located in the assets root. So now I'm doing this...

    // odd we have to do this...
    if(ENVIRONMENT !== 'production') {
    $config['assets_folders']['cache'] = 'cache/';
    }


    What is this further asset config for?

    // cache folder relative to the web root folder... must be writable directory (default is the application/assets/cache folder)
    $config['assets_cache_folder'] = 'cache/';


    In the latest Fuel (v1.3.2) this has no trailing slash. But the comment suggest it is set in the application folder in any case??
  • That comment is incorrect. It's actually just the assets/cache/ folder. What version are you using in production?
  • I've just updated to the latest.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!