# php.ini - realpath cache

**Project:** Servers | **Board:** Planned | **Votes:** 1
**URL:** https://roadmap.ploi.io/projects/1-server-level-requests/items/1228-phpini-realpath-cache

---

In addition to OPCache PHP has also the following options in php.ini:

```
; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
; Note: if open_basedir is set, the cache is disabled
; https://php.net/realpath-cache-size
realpath_cache_size = 4096k

; Duration of time, in seconds for which to cache realpath information for a given
; file or directory. For systems with rarely changing files, consider increasing this
; value.
; https://php.net/realpath-cache-ttl
realpath_cache_ttl = 120
```

This is disabled by default, just like OPCache, but greatly improves page loading times with scripts with a lot of includes, like Laravel / Composer autoloading.

See for example this Performance Checklist by Symfony: https://symfony.com/doc/current/performance.html#configure-the-php-realpath-cache

Something to enable by default for new configurations? Or a nice setting modal just like now for OPCache?

Thanks!
