niemeyer / gopkg

Source code for the gopkg.in service.
Other
539 stars 85 forks source link

cache godoc package data #70

Open vmpjdc opened 5 years ago

vmpjdc commented 5 years ago

Now that gopkg.in is hosted in the UK, godoc requests made while rendering the human-readable package pages take a lot longer (often a second or more). This branch adds a cache with a TTL of 1 hour.

Also, mainly as an exercise, I've removed dataMutex and replaced gotResp with a pair of string channels.

niemeyer commented 5 years ago

Sorry, I'm crazy. I mixed up the work I've done on the documentation proxy, which does have a nice cache, with this. Thanks for adding the cache. I'll send a review next.