also sprach Tim Chase <django.us...@tim.thechases.com> [2014-11-24 11:19 +0100]: > urlpatterns = patterns('', > url(r'^blob/([0-9a-f]{40})/$', 'myapp.views.render_blob', ...), > )
… this is straight-forward, thanks. I'd probably try not to expose the SHAs to the user but request from the Git library a blob identified by a path such as /path/to/file which the Git library should then map to the blob, given a treeish to use as a base (e.g. 'master', this could come from config). > In theory, you could also set the cache control headers in the > response so that they're ludicrously far in the future (assuming > you don't plan to change your my_template.html) because the blob > shouldn't ever change without having a different SHA1. Two problems I see with this: 1. If the SHA is not exposed, then a request path (see above) may well return different content on subsequent calls, so expiration-based caching isn't ideal; 2. aren't the cache-control headers for the caches downstream? Wouldn't this mean that if 1,000 clients requested a page, the reStructuredText processor would have to do the same work 1,000 times? I'd love to cache the result and serve that while the source file's pre-processing mtime hasn't changed. -- @martinkrafft | http://madduck.net/ | http://two.sentenc.es/ "i like wagner's music better than anybody's. it is so loud that one can talk the whole time without other people hearing what one says." -- oscar wilde spamtraps: madduck.bo...@madduck.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20141124104910.GA11742%40albatross.lehel.madduck.net. For more options, visit https://groups.google.com/d/optout.
digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)