Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81783

Re: Cherrypy - prevent browser "prefetch"?

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <israel@ravnalaska.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; ';-)': 0.03; 'cherrypy': 0.09; 'executes': 0.09; 'impose': 0.09; 'subject:Cherrypy': 0.09; 'cc:addr:python-list': 0.11; '"are': 0.16; '-tkc': 0.16; 'begging': 0.16; 'caching': 0.16; 'did,': 0.16; 'merely': 0.16; 'site).': 0.16; 'to:addr:python.list': 0.16; 'to:addr:tim.thechases.com': 0.16; 'to:name:tim chase': 0.16; 'wrote:': 0.18; 'app': 0.19; 'server,': 0.19; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'load': 0.23; 'proxy': 0.24; "shouldn't": 0.24; '(or': 0.24; 'cc:no real name:2**0': 0.24; 'performing': 0.26; 'post': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'skip:- 40': 0.29; 'tim': 0.29; 'dec': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'code': 0.31; 'requests': 0.31; 'serve': 0.31; 'chase': 0.31; 'go.': 0.31; 'probably': 0.32; 'front': 0.32; 'thanks!': 0.32; 'url:python': 0.33; 'cases': 0.33; 'google': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'doing': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'changing': 0.37; 'application': 0.37; 'two': 0.37; 'received:10': 0.37; 'server': 0.38; 'actions': 0.38; 'pm,': 0.38; 'rather': 0.38; 'does': 0.39; 'though,': 0.39; 'url:mail': 0.40; 'back': 0.62; 'header:Message-Id:1': 0.63; 'high': 0.63; 'skip:n 10': 0.64; 'sound': 0.68; 'request.': 0.70; 'received:12': 0.81; '2014,': 0.84; '4:26': 0.84; 'alaska': 0.84; 'batchelder': 0.84; 'bounce': 0.91; 'trouble.': 0.91; 'audit': 0.93
X-Warning RFC compliance checks disabled due to whitelist
X-Warning Reverse-Path DNS check skipped due to whitelist
X-Warning Maximum message size check skipped due to whitelist
X-Warning Realtime Block Lists skipped due to whitelist
X-Warning System filters skipped due to whitelist
X-Warning Domain filters skipped due to whitelist
X-Warning User filters skipped due to whitelist
X-Warning Anti-Spam check skipped due to whitelist
X-Whitelist 2147483645
X-Envelope-From israel@ravnalaska.net
X-Envelope-To ned@nedbatchelder.com
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject Re: Cherrypy - prevent browser "prefetch"?
From Israel Brewster <israel@ravnalaska.net>
In-Reply-To <20141201161207.725c041f@bigbox.christie.dr>
Date Mon, 1 Dec 2014 13:19:36 -0900
Content-Transfer-Encoding quoted-printable
References <6B74D6DD-A597-4BCF-8586-D0A56C9CDB77@ravnalaska.net> <20141201152608.09ca6f13@bigbox.christie.dr> <m5inqh$kdt$1@ger.gmane.org> <20141201161207.725c041f@bigbox.christie.dr>
To Tim Chase <python.list@tim.thechases.com>
X-Mailer Apple Mail (2.1878.6)
Cc python-list@python.org, Ned Batchelder <ned@nedbatchelder.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16475.1417472379.18130.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417472379 news.xs4all.nl 2946 [2001:888:2000:d::a6]:40300
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81783

Show key headers only | View raw


On Dec 1, 2014, at 1:12 PM, Tim Chase <python.list@tim.thechases.com> wrote:

> On 2014-12-01 16:50, Ned Batchelder wrote:
>> On 12/1/14 4:26 PM, Tim Chase wrote:
>>> All this to also say that performing non-idempotent actions on a
>>> GET request is just begging for trouble. ;-)
>> 
>> This is the key point: your web application shouldn't be doing
>> these kinds of actions in response to a GET request.  Make them
>> POST requests, and Safari won't give you any trouble.
> 
> Though to be fair, based on the reading I did, Safari also pulls in
> the various JS and executes it too, meaning that merely
> (pre)"viewing" the page triggers any Google Analytics (or other
> analytics) code you have on that page, sending "page views" with a
> high bounce rate (looks like you only hit one page and never browsed
> elsewhere on the site).
> 
> Additionally, if the target GET URL involves high processing load on
> the server, it might be worthwhile to put a caching proxy in front of
> it to serve (semi)stale data for any preview request rather than
> impose additional load on the server just so a preview can be updated.

Right, and there are probably some URL's in my app where this may be the case - I still need to go back and audit the code now that I'm aware of this going on. In general, though, it does sound as though changing things to POST requests, and disallowing GET requests for those URLS in my CherryPy app is the way to go.

Thanks!

> 
> So I can see at least two cases in which you might want to sniff the
> "are you just previewing, or do you actually want the page"
> information.  Perhaps there are more.
> 
> -tkc
> 
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Cherrypy - prevent browser "prefetch"? Israel Brewster <israel@ravnalaska.net> - 2014-12-01 13:19 -0900

csiph-web