pleini

Disable FileCompiler and run once after deployment

Recommended Posts

Hey,

I have a question regarding the fileCompiler: is it possible to compile all files (templates + modules) with the filecompiler at once after a deploy (in a composerPostinstall for example) and disable it afterwards completely. The problem is, when i am deploying a new version to my instances, the cache folders might be replaced, so the files need to be recompiled when the first user is visiting the page after deployment. With that "pre-compilation" i want to prevent that the users have to wait for the filecompiler to compile.

Thanks

Chris

Share this post


Link to post
Share on other sites

Is there a reason to replace the cache folder? Normally one would exclude such folders from deployments.

Share this post


Link to post
Share on other sites

We have a autoscaling Application with multiple instances, which can be replaced by the autoscaling, what means that its a completely new instance, so the cache folder does not exist and has to be filled again by the compiler. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By usualCommission
      I'm building a site that renders certain features using reusable classes. Unfortunately FileCompiler caches the files and my changes don't show up unless I clear the FileCompiler cache.
      On top of that, when I try to use the wire() function inside a class it throws a "Fatal error: Uncaught Error: Call to undefined function wire()". I've tried playing with ProcessWire namespacing, but have come up short.
      My files are structured as such:
      app.php - Is included in my templates and loads classes as they're called with spl_autoload_register.
      - classes/ExampleClass.class.php - Loaded by app.php
      Thanks!
       
    • By hellomoto
      There is no reason for this to have happened, I was not working on anything related to this:
      I deleted the site cache and it's still happening. The whole site is broken. This is what happened last time and I had to rebuild. Now I'll have to again. I really need to use version control this time for sure. But nonetheless, I wasn't even working on these files.
    • By pleini
      Hello Guys,
      i have a question regarding the fileCompiler of PW 3.x. On my page i am monitoring the execution times and sometimes i have some peaks in the execution time. I profiled the code and i recognized that those peaks come from the fileCompiler, more specific from the function compileNamespace (preg_match_all takes the most time).
      So my question is, how does the FileCompiler decides when it compiles the files, and would it be possible that i trigger the compilation of all files after a new deployment so that during requests of visitors of my page there are no compilations, to keep the loading times as low as possible?
       
      thank you
      Joscha