Web lists-archives.com

[PHP] How to preload opcache dirs ?


I'm trying to use my php app and php7 in AWS lambda. Lambda doesn't
natively support php, so I need to proxy through nodejs.

A problem with lambda is the more application files accessed from disk
increases request response time. Once a cold start is completed, php7 can
be very fast. eg. 0.066ms. Lambda periodically recycles instances, meaning
once php byte code is in opcache, the instance may be discarded forcing
cold start compiles on the next request. Memcached cannot be used in the
Lambda configuration

I'd like to find a way to precompile my php code and place the byte code
into opcache's directory.

I'm not sure how to make this work. Suggestions appreciated