Login

Snippets by crime_minister

Snippet List

[middleware] Rewrite anchors to point into Coral CDN

This simple middleware rewrites the 'href' attribute of any `<a>` tags in your response content. The URL href is modified by appending the string '.nyud.net', which causes the Coral Content Distribution Network to retrieve a copy of the page and cache it before returning it to the user agent. This might be useful if you're writing another Slashdot and you want to avoid turning the servers you link to into smoking craters. You [should be able](http://www.djangosnippets.org/snippets/910/) to apply this functionality to a single view as well (though I haven't tried this yet).

  • middleware
  • coral
  • cdn
  • anchor-rewrite
Read More

crime_minister has posted 1 snippet.