This can be done with Lua but a better question would be; is this file contents going to change alot and/or if the file exists does it need to continually be tested for its existence?
Any file IO is blocking, a 'one' time test/read and then cache it is not going to be a problem, if this needs to happen with every request users make this will slow things down alot.
Using a timer you could periodically test and update the cache but you would always have some delay after content changes.
Any file IO is blocking, a 'one' time test/read and then cache it is not going to be a problem, if this needs to happen with every request users make this will slow things down alot.
Using a timer you could periodically test and update the cache but you would always have some delay after content changes.