Question about possible website caching issue

first dumb question of the month:

hello - I have a development website for example:

https: / / DEV.XXXX.com

and a live site:

https: / / XXXX.com

to temporarily test the development in a “live” mode, I did the following:

mv /home/XXXX.com/public_html/ /home/XXXX/public_html-SAVED/ ;

ln -s /home/XXXX.com/domains/dev.XXXX.com/public_html/ /home/XXXX.com/ ;

and to reset:

rm /home/XXXX.com/public_html ; ## interesting that to remove a symbolic link we omit the trailing slash

mv /home/XXXX.com/public_html-SAVED /home/XXXX.com/public_html ;

however, for some reason, the test website (or some of it) remained “live”. i confirmed this using incognito mode and also confirmed this using browserstack.

i tried the following to try to “flush” the temp website out:

systemctl restart systemd-resolved.service
systemctl restart httpd.service ;
systemctl restart php-fpm.service ;

none of these fixed it. so I finally rebooted out of sheer desperation, and that fixed it.

was there another way I should have fixed this? or perhaps a system service I overlooked?

or perhaps something like:

systemctl restart @.service ; ## just guessing here

Linux 4.18.0-553.16.1.el8_10.x86_64
NAME=“Rocky Linux”
VERSION=“8.10 (Green Obsidian)”

Webmin version 2.202 Usermin version 2.102
Virtualmin version 7.20.2 Pro

side note: I have been using virtualmin/webmin for over a decade now, and love it more and more every day.

i wrote a tiny script that may have fixed the problem:

#! /bin/bash -w

systemctl stop httpd.service ;
systemctl stop php-fpm.service ;
systemctl stop systemd-resolved.service ;
htcacheclean -v -D -p/var/cache/httpd/ssl -l1024M ### apache cache flushe ;
systemctl start httpd.service ;
systemctl start php-fpm.service ;
systemctl start systemd-resolved.service ;

once the site is finally migrated, of course I won’t be doing this anymore. but still its a strange issue.

1 Like