HackerTrans
热门最新趋势评论往期问答秀出招聘

protonfish

no profile record

评论

protonfish
·6年前·讨论
It makes sense that a company with a business model based on mining and selling personal data would not find mobile web to be acceptable - too many privacy and security protections that can be eschewed on native. For the same reasons, consumers should choose HTML.
protonfish
·8年前·讨论
Cool, that makes sense. You should be able to easily turn off etags in your nginx config. This won't just save bytes in your response headers, but will stop a lot of HEAD requests to your server that are required to do validation caching.
protonfish
·8年前·讨论
It can be, but doesn't need to be as long as it is some sort of indication of the uniqueness of the content. A last modified date should work in the same way.
protonfish
·8年前·讨论
Unfortunately there is no "never" setting. The HTTP spec recommends 1 year.
protonfish
·8年前·讨论
Even if it did save bandwidth, that does not equal significant energy savings. And if it did, there are better ways to save.

For example, looking at their response headers I see the image cache control expires after a day, plus has validation caching. This could be significantly improved. First, get rid of the `etag`, `expires`, and `last-modified` headers and go with expiration caching only. Increase the `max-age` from one day (86400) to one year (31536000). I get the HTML expiring after 24 hours, but images should be more aggressively cached. Validation caching always requires a round trip to the server, plus running validation rules on every single request so it can't save nearly as much bandwith and CPU as simple expiration caching.

Also, if they got rid of the those headers, plus the pointless `server: nginx/1.10.3` they could save over 100b per HTTP response. I counted 19 requests on that article, so it may seem small, but it can add up to a significant amount.