Issue with cache and symlink deployment

Jinesh

Well-Known Member
#1
Hi.

I'm developing some projects on shared hosting (cloudlinux+ls+lsapiphp)

We are using phpdeployer to deploy projects (https://showbox.tools/).

In short it creates releases everytime we deploy (ie: releases/54, releases/55, etc). And then it points the new release to 'current' (ie: /home/user/site/current -> /home/user/site/releases/55).

/home/user/public_html points to /home/user/site/current/public.

All of this works, except when people are on the website during deployements it looks like symlinks paths are cached and it causes some files to be loaded twice / load an old version.

With PHP-FPM this is easy, we simply add: sudo service php7.2-fpm restart and we're done.. There's no such thing with LSAPI. I have tried create a script that clears PHP's realpath cache, resets opcache, adding the header("X-LiteSpeed-Purge: *") tag to every page. Nope.

How do I clear every possible cache, more specially tell LSAPI's php to "reset" whatever it knows about symlinks? With nginx there is $realpath_root we can pass to PHP to avoid those issues, not sure there's such a thing with Litespeed.
 
Last edited:
Top