战争部署的外部资源与内部资源,例如 Tomcat
我有一个 Web 应用程序,当前使用外部目录在 Spring Web 应用程序中托管静态文件,例如 css、velocity。也就是说,该目录位于 tomcat 的 webapp 目录内,但不在 WAR 内。
除了能够轻松编辑这些资源而不需要重新编译包部署之外,不将这些文件包含在战争中还有什么好处。
我似乎记得很久以前就被告知 Tomcat 在提供文件静态文件方面的性能很差,但我没有任何经验来支持这一点。据我所知,唯一的优点是易于编辑。
I have a web app that current uses an external directory to host static files, e.g css, velocity, in a Spring webapp. That is, the directory is inside tomcat's webapp directory but not inside the WAR.
Other than the ability to easily edit these resources without needing to recompile-package-deploy is there any advantage to not including these files inside the war.
I seem to recall being told A LONG TIME AGO that Tomcat had poor performance in serving files static files, but I don't have any experience that backs this up. As far as I'm aware the only advantage is that of ease of editing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,Web 服务器在应用程序服务器前面模式仍然有效:
毫无疑问,根据您的用例,它可能看起来有所不同:
将网络服务器和应用程序服务器放在同一节点上会降低提供网络服务器的优势。我的经验是,当涉及“少数用户”使用的“较小”内部应用程序时,不需要 Web 服务器,tomcat 就可以很好地服务。如果您的应用仅提供一些静态文件,例如图标、css和javascript,则尤其如此。
希望这有帮助...
In general the web server in front of application server pattern is still valid:
No question, depending on your use case it may look different:
Having web server and application server on the same nodes reduces the advantages of providing a web server. My experience is that when it comes to 'smaller' internal applications used by 'a few users' a web server is not necessary and tomcat serves well. This is especially true if your app only serves some static files like icons, css and javascript.
Hope this helps...