I know sneakyimp was talking about it ... probably 4 years ago.

My question: should I tell OPCache to ignore my /js subdirectory?

    The documentation seems a bit sparse but I don't think that OPCache is about caching compiled PHP bytecode, and this would not affect JS files because these are not PHP. I have always assumed that OPCache should be smart enough to invalidate a cached file if the file is altered.

    If you are having difficulty with JS files getting cached, this might have something to do with your web server configuration? IIRC, apache might be configured to send cache directives for certain MIME types?

      I was looking at opcache_get_status() and it is caching JS files. I don't need it using RAM for that unless it's going to help ... and I don't think we do at all, as it's the browser's job to cache JS, CSS, etc.

      Thanks for the link and reply.

      I'm just going to blacklist js/* and css/* ... I don't think there is any particular advantage to having those served by the PHP Opcache.

        dalecosp I don't need it using RAM for that unless it's going to help ...

        Any server RAM otherwise going unused is already appropriated by the filesystem as a file cache. Chances are good that static asset files are already cached there.

          Right! ... and really, we're depending on the client to cache CSS and JS unless we change the tags on the server side anyway. 🙂

            Write a Reply...