Support » Plugin: Autoptimize » Add ability to specify cache folder

  • Resolved Jassi Bacha

    (@klikster)



    Hi there,

    I’ve been using Autoptimize for quite a while with a bunch of WordPress sites, but I’ve recently started hosting some clients on Pantheon. Pantheon has a strict file/code structure and I’m not able to get write permissions to /wp-content/cache like Autoptimize requires. I need to move it to /wp-content/uploads/cache but there’s no current option to do something like this.

    I’m unsure of how much work a feature like this would be, but I think it’s something that quite a few people would find useful. I’ll be migrating most of my WordPress clients over to Pantheon throughout the next few months and I’d love to keep using Autoptimize because it works exceptionally well! 🙂

    Would there possibly be a function I could add in my theme’s functions.php to override that path?

    https://wordpress.org/plugins/autoptimize/

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

    (@futtta)

    Hi Jassi;
    There’s no function in the API available to do that, but I’ll put it on the list of possible improvements. I don’t know Phanteon, but maybe it’s possible to create /wp-content/cache as a symlink of /wp-content/uploads/cache as a temporary workaround?

    Kind regards,
    frank

    Hi Frank,

    I hadn’t considered doing a symlink. That likely would work. Thanks!

    Plugin Author Frank Goossens

    (@futtta)

    Well, it’s me again; I added functionality to the soon-to-be-released 1.9.2. In wp-config.php you will be able to configure something like this;

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

    which will change the path to a autoptimized CSS-file from /wp-content/cache/autoptimize/autoptimize_12345.css to /wp-content/cachetimize/aggregated_12345.css.

    It would be great if you could download the pre-release here, give it a spin and report back here 🙂

    thanks,
    frank

    Hi Frank,

    Just FYI I tried downloading the pre-release and editing my wp-config.php accordingly, but this did not have the desired effect. The Cache folder was still set to
    wp-content/cache/autoptimize/.

    If I manually edited autoptimize.php at line 27, things did work as expected.

    Plugin Author Frank Goossens

    (@futtta)

    hmmm … so what did you have in wp-config.php?

    (no use in using the pre-release, this was pushed out late december)

    kind regards,
    frank

    Hi Frank,

    My bad. I didn’t close a comment in my wp-config.php. I have now done so and it works! Sorry for the false alarm.

    Plugin Author Frank Goossens

    (@futtta)

    no problem, glad it works as intended 😉

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add ability to specify cache folder’ is closed to new replies.