Serving up snippets of html and using urlfetch
I'm trying to "modularize" a section of an appengine website where a profile is requested as a small h开发者_开发问答unk of pre-rendered html
Sending a request to /userInfo?id=4992 sends down some html like:
<div> (image of john) John Information about this user </div>
So, from my google appengine code, I need to be able to repeatedly fetch results from this URL when displaying a group of people.
The only way I can do it now is send down a collection of <iframes> like
<iframe src="/userInfo?id=4992"></iframe> <iframe src="/userInfo?id=4993"></iframe> <iframe src="/userInfo?id=4994"></iframe>
The iframes work to request the data.
I tried using urlfetch.fetch() but it keeps timing out on me.
Am I doing this right? I thought this would be handy-dandy (url that serves up a snippet of html) but it turns out its looking like a design error.
You're currently serializing urlfetch requests, which ends up summing their wait times and may easily push you beyond your latency deadline. I'm afraid that you'll need to switch to async urlfetch requests -- an advanced technique which may suit your architecture better!
精彩评论