• douglaskarr

    (@douglaskarr)


    This is a fantastic plugin, but the cache folder isn’t in the uploads folder so some secure hosts disable the ability to write. Currently, the folder is in /wp-content/cache/autoptimize but should be moved to /wp-content/uploads/cache/autoptimize

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Morning Douglas;
    As per the FAQ you can change where AO writes the cache:

    Can I change the directory & filename of cached autoptimize files?
    Yes, if you want to serve files from e.g. /wp-content/resources/aggregated_12345.css instead of the default /wp-content/cache/autoptimize/autoptimize_12345.css, then add this to wp-config.php:

    define('AUTOPTIMIZE_CACHE_CHILD_DIR','/resources/');
    define('AUTOPTIMIZE_CACHEFILE_PREFIX','aggregated_');

    hope this helps,
    frank

    Thread Starter douglaskarr

    (@douglaskarr)

    Many thanks!

    Thread Starter douglaskarr

    (@douglaskarr)

    @futtta

    I attempted to change the directory per the wp-config.php as you mentioned but it didn’t do anything:
    define('AUTOPTIMIZE_CACHE_CHILD_DIR', ABSPATH.UPLOADS.'/cache/autoptimize/');

    Still results in the cache folder defined in Cache Info:
    /wp-content/cache/autoptimize/

    Any ideas?

    Plugin Author Frank Goossens

    (@futtta)

    hmmm, 2 things;
    * i vaguely remember the place where you add the code in wp-config.php is important, try moving the define around?
    * try with a hardcoded path first ('wp-content/uploads/' instead of ABSPATH.UPLOADS)?

    frank

    Thread Starter douglaskarr

    (@douglaskarr)

    @futtta yes, that was it! It appears that AUTOPTIMIZE_CACHE_CHILD_DIR includes the wp-content folder; as a result, I was able to set the directory with:
    define('AUTOPTIMIZE_CACHE_CHILD_DIR', '/uploads/cache/autoptimize/');

    And that line of code must be inserted prior to:
    require_once(ABSPATH . 'wp-settings.php');

    Thanks again for the assistance!

    Plugin Author Frank Goossens

    (@futtta)

    you’re welcome Douglas ??

    Thread Starter douglaskarr

    (@douglaskarr)

    My client is using Pantheon, a really nice development and hosting platform for WordPress. Unfortunately, while these edits worked… cache files with a .php extension are locked and not executed by the server.

    Is there any means of changing the extensions of these files to .js or .css respectively?

    Thanks!

    Plugin Author Frank Goossens

    (@futtta)

    tick the very last option, “Save aggregated script/css as static files?” and AO will switch to .js and .css Douglas.

    Thread Starter douglaskarr

    (@douglaskarr)

    I owe you a coffee (and then some!)

    Thread Starter douglaskarr

    (@douglaskarr)

    Updated to 5 stars, very appreciative!

    Plugin Author Frank Goossens

    (@futtta)

    thanks, have yourself a nice day (or night in your timezone now) Douglas!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Well-Supported Plugin with Plenty of Options’ is closed to new replies.