简体   繁体   English

Apache,Nginx和静态内容

[英]Apache, Nginx, and static content

There seems to be a consensus that Nginx serves static content faster than Apache. 似乎已经达成共识,Nginx提供静态内容的速度比Apache快。 However, I'm not really sure what this means. 但是,我不确定这意味着什么。 For example, I have a script that generates an image only if the same image doesn't already exist in the cache. 例如,我有一个脚本, 当缓存中不存在相同图像时才会生成图像。 If it does exist in the cache, the script simply returns the public address of the image. 如果缓存中确实存在该脚本,则脚本仅返回映像的公共地址。

Would this be considered dynamic, static, or both? 将其视为动态的,静态的还是两者兼有? More importantly, would Nginx still have a speed advantage with this kind of scenario? 更重要的是,在这种情况下Nginx是否仍将具有速度优势?

In the context of web servers, "static" usually means the content is already known to exist in a file on disk and is not generated dynamically by running a program of any kind. 在Web服务器的上下文中,“静态”通常表示已知内容存在于磁盘上的文件中,并且不会通过运行任何类型的程序动态生成。

It sounds like your script, since it's a script, is dynamic content. 听起来您的脚本是动态内容,因为它是一个脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM