bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Send username with API calls if available? #40

Closed GaryJones closed 10 years ago

GaryJones commented 10 years ago

As per @bradyvercher's suggestion.

https://gist.github.com/a8cd3a1066d8047a6187.json#file-foo-bar-php

^ That automatically gets redirected to https://gist.github.com/GaryJones/a8cd3a1066d8047a6187.json#file-foo-bar-php

While quick, if we already have the username available, the API call URL should include it to avoid that small delay.

One drawback worth mentioning though - should two posts reference the same Gist, but one with a namespace and one without, then the results will be stored under different transient keys. If that takes priority, then we can stay as we are, not including the username at all, and let GitHub handle any redirects it wants to now or in the future.

bradyvercher commented 10 years ago

Good point about the double storage. The username is really only going to come into play with the oEmbed method, so we'll just let GitHub handle the redirects.