4 ms·
They should send a special HTTP request header along with pre-load requests so site owners can choose to block them. Eg web browser sends a request with the he
by mike-cardwell 15y ago
They should send a special HTTP request header along with pre-load requests so site owners can choose to block them.
Eg web browser sends a request with the header:
X-Page-Preload: Something
I configure my webserver to 403 any requests with that header.
- alexchamberlain 15y agoWhy would you block them, especially for static pages?
- deleted 15y ago[deleted]
- mike-cardwell 15y agoTo save resources
- alexchamberlain 15y agoBandwidth I guess, but I conject that it wouldn't starve most servers resources on static files. Coupled with good cache settings, I think this is a great move forward. Imagine when I request Hacker News (too often), if it could download the HTML and the site returned NOT MODIFIED on everything else before I've even pressed enter, it could be displayed straight away, with little pressure on the server.
- ryandvm 15y agoMy guess is that the effort of blacklisting them is going to cost you far more than the false positives will. Not to mention a less swift experience for your users. Unless of course you are the admin for http://www.faceboo.com/ http://www.faceboo.com/
- michaelmior 15y agoAgreed. It seems like Google has no desire to implement this however. Presumably because they feel prerendering will give Chrome a significant speed advantage and they don't want site owners to opt out from day one. Looks like the best you can get is a JS property once the page is loaded. http://code.google.com/chrome/whitepapers/pagevisibility.html http://code.google.com/chrome/whitepapers/pagevisibility.htm...
- icebraining 15y agoit seems like Google has no desire to implement this however Why do you say that? They seem to send "X-Purpose: instant", at least according to their FAQ[1] and bug reports[2]. [1]: http://www.google.co.uk/chrome/intl/en-GB/webmasters-faq.html#instant http://www.google.co.uk/chrome/intl/en-GB/webmasters-faq.htm... [2]: https://code.google.com/p/chromium/issues/detail?id=91735 https://code.google.com/p/chromium/issues/detail?id=91735
- michaelmior 15y agoCool. I couldn't find any reference to this in the FAQ when I was reading :)
- icebraining 15y agoApparently they do, they send X-Purpose: instant (http://www.google.co.uk/chrome/intl/en-GB/webmasters-faq.html#instant http://www.google.co.uk/chrome/intl/en-GB/webmasters-faq.htm...)
- paraschopra 15y agoBut 3rd party JavaScript libraries (like GA or ours) cannot read such headers and will invariably get executed. How would Google Analytics recognize and discard such irrelevant requests?
- mike-cardwell 15y agoWill the javascript even be executed during this "pre-rendering" process? It's the people with server side analytics that are going to be affected most by it.
- icebraining 15y agoI dunno, use the Page Visibility API[1]? [1]: http://www.w3.org/TR/2011/WD-page-visibility-20110602/ http://www.w3.org/TR/2011/WD-page-visibility-20110602/
- mike-cardwell 15y agoThat's good to know. That can be used to do what I want.
- alexchamberlain 15y agoTo disable this behaviour, Detect this and return an HTTP 403 ("Forbidden") status code. Then you will blacklisted client side. I'm not sure I like this, since it will slow down your site until the blacklist gets cleared up if the user accesses a page they are forbidden for.
- icebraining 15y agoYeah, but on the other hand it's hard to find an appropriate status code. Since prefetching is a common feature in many browsers they should agree on a new code, there are still plenty of 4XX available.