# How do you change the default cache path

**URL:** https://discourse.roots.io/t/how-do-you-change-the-default-cache-path/25488
**Category:** sage
**Tags:** acorn, sage10
**Created:** 2023-06-06T14:17:11Z
**Posts:** 5

## Post 1 by @JasonSalmon — 2023-06-06T14:17:12Z

Hey I hope someone might be able to help.

I’ve just updated acorn to v3 and prior to this i was using the following adding the following filter to functions.php to change the cache directory as the host I’m using doesn’t allow me to use wp-content.

```
add_filter('acorn/paths.storage', function ($path) {
    return '/tmp/sage-cache/';
  });
```

It looks as though this filter has changed/removed and I was wondering what is the best way now to change the cache path?

Many thanks  
Jason

---

## Post 2 by @thunderdw — 2023-06-06T14:40:51Z

If the filter isn’t running early enough it might not work. You can set the `ACORN_STORAGE_PATH` constant instead of using the filter.

---

## Post 3 by @JasonSalmon — 2023-06-06T16:24:52Z

Thanks for the reply.

Should the filter still work? Its just that in acorn v2 in BootloaderTest.php

```
$this->filter('acorn/paths.storage', fn () => temp('storage'));
```

And in acorn v3 i can’t find that or similar. If it should and its a case of not running earlier enough where should i put it so that it does?

If i was to use the constant instead where would the best place to put it within the theme?

I really appreciate your help.

---

## Post 4 by @strarsis — 2023-06-06T16:31:46Z

The `acorn` `3.x` specific cache configuration can be found here, IMHO:

> <https://github.com/roots/acorn/blob/2ccffc169f9dba05499f7dbb6e2d30f2809312de/config/cache.php#L54>

---

## Post 5 by @thunderdw — 2023-06-06T18:03:10Z

If you’re using Bedrock, you can define `ACORN_STORAGE_PATH` in your `config/application.php`. If you’re not using Bedrock, you can define it in your `wp-config.php` file.
