简体   繁体   中英

Optimizing webapp static content in jetty

I was reviewing some jetty configs and I noticed some examples of using a context specific for static content.

If I have static content inside my webapp will it improve performance to create a static content for those resources?

Performance wise your best bet it to use the DefaultServlet to serve those static files and set a sane caching policy on them. Also let the default servlet serve the files with direct memory buffers, its will be about as optimal as you can get.

The resource handler is a good way to serve out static content but the DefaultServlet has more options for improving the actual performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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