Does this function cache correctly?
You can simplify (and sometimes speed up) things like this

try:
    a = memcache.get('ads')
except KeyError:
    a = Ad.all().filter('modified &gt;',
                            start).filter('published =',
                True).order('-modified').fetch(count)
    memcache.set('ads', a)


It's (often) slightly faster in Python to avoid the if statement.

After measuring that with timeit, you should rename the variable a.  That's a poor name.