Giter Club home page Giter Club logo

Comments (3)

gordalina avatar gordalina commented on July 3, 2024 6

Okay I get what opcache reset does now, but why do I have to invalidate the files of the directory of the subdomain where I want the opcache to clear? Did you mean that I have to invalidate all other directories except for the subdomain I want it to work for?

It seems that you only want to reset cache for a specific directory (a subdomain), the opcache:invalidate:scripts command will do exactly that.

And also when I run the command will all the subdomains on the specific domain be cleared or will all domains on the server be cleared?

The invalidate scripts command will only reset the opcache for the files within the given directory, so if you point to to the subdomain directory, it will reset the opcache for that directory, not the rest of the server.

In essence, wp_opcache_invalidate_directory('/path/to/subdomain') is the same as running cachetool:

$ cachetool opcache:invalidate:scripts /path/to/subdomain"

Feel free to comment on this issue, no need to open a new one.

from cachetool.

lkraav avatar lkraav commented on July 3, 2024 1

Maybe related: for upcoming release, WP built a short function wp_opcache_invalidate_directory()

https://make.wordpress.org/core/2023/02/03/faster-updates-testing-complete/

I've also been wondering how to avoid nuking full opcache for just single known subdirectory changes.

from cachetool.

Yokai-dev avatar Yokai-dev commented on July 3, 2024

That's a great function.
Thanks for redirecting me to this link.
And yeah It's kinda annoying it immediately nukes all things with opcache reset.

Anyways thanks for the reference to the link, hopefully there will be better solutions soon.

from cachetool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.