我昨天注意到这个网站顶部有一个新的导航栏。它还在导航栏上添加了更多功能,这些功能肯定需要服务器端更改或至少更新的查询。
是的,它作为变量附加到 css,以便每次访问都会加载一个新副本。我想知道他们如何完成更改,即在不停机的情况下交换文件?
也许后面还有很多其他的事情,任何洞察力都会很好。谢谢。
我昨天注意到这个网站顶部有一个新的导航栏。它还在导航栏上添加了更多功能,这些功能肯定需要服务器端更改或至少更新的查询。
是的,它作为变量附加到 css,以便每次访问都会加载一个新副本。我想知道他们如何完成更改,即在不停机的情况下交换文件?
也许后面还有很多其他的事情,任何洞察力都会很好。谢谢。
Although I don't think this question belongs in StackOverflow, I have some experience about changing a running website.
We had 3 different servers: Development, Stage, Production. We did all the development in development server. Then when we decided to migrate, we copied public_html folder with a different name to the same folder that current public_html resides in. Then we would swap names of the folders and, voila. We had a script that did that automatically: Pull from git, swap names.
We tested the script on stage server and if it didn't fail, we applied the same to the production server.
You can also change apache config to look for your new folder. Think of it as 'double buffering', old site is a buffer. The new site is loaded into a new buffer, then apache configuration is changed so that the new folder is used, ie. the buffers are swapped.
Swapping names is no big deal and I didn't experience any bad side effects to this method. But I guess changing apache config is a better idea.
Well nobody knows how they really do it but what we do:
Use a staging server where your whole website is duplicated. Make all your changes there without nobody knowing what's happening as the website is provided by another server. And then just change your domain configuration so that the staging server becomes the new webserver and the other way arround.