简体   繁体   English

如何更有效地提供基于文本的网页?

[英]What can I do to serve text-based webpages more efficiently?

For context I am trying to get a webserver up and running with low specs (think Raspberry Pi level) and want it to serve text content to as many users as possible. 对于上下文,我试图让网络服务器启动并运行低规格(想想Raspberry Pi级别),并希望它为尽可能多的用户提供文本内容。

I have tried looking up general tips, and this was helpful ...but I can't believe that it's completely pointless to use Javascript to de-encode a website that's been compressed. 我试过查找一般提示,这很有帮助 ......但我无法相信使用Javascript对已经压缩的网站进行解码是完全没有意义的。 If I took a simple cipher to replace each instance of ' <div ' with a special character I know I would never serve (some of these maybe), wouldn't I already be saving some bandwidth? 如果我把一个简单的密码来替代“的每个实例<div特殊字符我知道我永远不会成为(一些” 这些也许),不会我已经节省了一些带宽? A JS search and replace on the client side can't take more than a fraction of a second. 客户端的JS搜索和替换不能超过一秒钟。

So my question is are any of these novel methods for speeding up simple websites worth it in the end? 因此,我的问题是,这些新颖的方法可以最终使值得简化的简单网站加速吗? Are there other methods I am not considering? 还有其他我不考虑的方法吗?

The http-protocoll supports gzip compression natively. http-protocoll本机支持gzip压缩。 There is no further benefit in replacing 替换没有进一步的好处
"<div " with "x". “ <div”和“ x”。 In order to improve performance you can tell your web-server to serve files that are already gzip-compressed. 为了提高性能,您可以告诉您的Web服务器提供已经过gzip压缩的文件。 I did that once and it cut down page loading time about 10 milliseconds on a shared hoster using apache. 我做了一次,它在使用Apache的共享主机上减少了页面加载时间约10毫秒。

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

相关问题 在我的基于文本的游戏中出现特定对话行后,如何替换图像? - How do I replace an image after a specific line of dialogue in my text-based game appears? 在 Fabric.js 中调整基于文本的对象的大小时,如何防止包含文本的垂直和水平拉伸? - How can I prevent both vertical and horizontal stretching of contained text while resizing text-based objects in Fabric.js? 我正在制作一个基于文本的RPG,你可以在每个屏幕上说是或否,我需要帮助删除eventlistener - I am making a text-based RPG, and you can say yes or no on each screen, and I need help removing the eventlistener 基于文本的游戏代码不起作用? - Text-based game code not working? 基于JavaScript文本的宠物游戏 - JavaScript text-based pet game 我如何才能更有效地重写 - How Can I Rewrite This More Efficiently 我如何才能更有效地编写此内容? - How can I write this more efficiently? 我需要根据用户类型来搜索文本,但是可能有成百上千个页面,如何有效地做到这一点 - I need to search text as a user types, but it can potentially be hundreds or thousands of pages, how can I do this efficiently 如何更有效地做到这一点? - How to do it more efficiently? 在JavaScript中创建一系列基于控制台文本的输入? - Creating a series of console text-based inputs in JavaScript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM