Serving either static or dynamic content depending on query parameters

15 views
Skip to first unread message

Daniel Erat

unread,
Nov 8, 2011, 10:04:39 AM11/8/11
to google-a...@googlegroups.com
I'm attempting to make my app support Google's "AJAX Crawling" initiative, as described at http://code.google.com/web/ajaxcrawling/docs/getting-started.html.  My URLs currently look like http://domain/#state; I'll need to change them to http://domain/#!state and additionally serve a non-AJAX version of the content when I get a request like http://domain/?_escaped_fragment_=state.

My app has a static handler for /:

- url: /
  static_files: static/index.html
  upload: static/index.html

Ideally, I'd continue to use this handler for regular requests while using a separate script handler to generate non-AJAX pages for ?_escaped_fragment_ requests.  There doesn't seem to be any way to take a request's query parameters into account within app.yaml, though.  As such, the only option I can think of is to instead send all requests for / to a script that either reads and sends the index.html file or generates the non-AJAX version of the page.  Is this correct?  I'm a bit concerned about reduced efficiency from doing this (and also not excited about needing to implement things like 304s).
Reply all
Reply to author
Forward
0 new messages