duckduckgo/p5-app-duckpan — pull request #31 by nospampleasemam (2013-10-10 07:03:38+00:00)
Title: send If-Modified-Since headers w/ update check

DuckPAN startup is painfully slow, mostly thanks to the numerous HTTP
requests it makes. This change (judging by an entirely unscientific
test) shaves off about 4 seconds from the start. It does so by sending
If-Modified-Since headers with the HTML/JS update checks, based of the
last modified time of the files in cache and checking for an HTTP 304
Not Modified status in the response.

duckpan server 0.90s user 0.03s system 11% cpu 7.967 total
duckpan -I../p5-app-duckpan/lib server 0.82s user 0.05s system 24% cpu 3.578 total

Another possibility is to use ETags to do data validation (which NGiNX
is sending), but would be trickier to implement with little gain.

This changeset depends on an internal PR - do not merge before it is
merged.