Changeset 9391


Ignore:
Timestamp:
Jul 12, 2011, 11:09:17 AM (14 years ago)
Author:
rick
Message:

Get some hints on when cache is used and when we are fetching data actually. To check if we do not exeeed the bandwidth limitations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/wlheatmap/osm_proxy.py

    r9192 r9391  
    1111import urllib
    1212
     13import logging
     14logger = logging.getLogger(__name__)
     15
     16
    1317# Create your views here.
    14 @cache_page(cache=settings.OSM_CACHE)
     18@cache_page(60 * 60 * 24 * 7)
    1519def osm_proxy(request,zoom,x,y):
    1620  mirror = random.choice(['a','b','c'])
    1721  url = 'http://%s.tile.openstreetmap.org/%s/%s/%s.png' % (mirror, zoom, x, y)
     22  logger.info("Fetching tile from %s" % url)
    1823  data = urllib.urlopen(url).read()
    1924  response = HttpResponse(mimetype="image/png")
Note: See TracChangeset for help on using the changeset viewer.