Would you like to make hoogle.haskell.org faster?

PSA: Unlike most haskell services, hoogle.haskell.org is slower outside the US (eg 1s response time in Europe vs. 1/4s).

This is apparently because of its basic web app which does not provide good caching headers. If you’d like to make it more cacheable, I’m sure that would be welcome at https://github.com/ndmitchell/hoogle.

14 Likes

Is there a path for achieving this? I’m not an expert nor have I contributed to hoogle before, but I’m willing to learn and make contributions.

4 Likes
2 Likes

Can’t we just use Nginx as cache?

From a cursory analysis of the HTTP headers of hoogle:

HTTP/1.1 200 OK
CF-Cache-Status: DYNAMIC
CF-RAY: 8e415441084bd642-CDG
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html
Date: Sun, 17 Nov 2024 17:09:33 GMT
Server: cloudflare
Transfer-Encoding: chunked
content-security-policy: default-src 'self'; script-src 'self' https://code.jquery.com/ https://rawcdn.githack.com; style-src 'self' 'unsafe-inline' https://rawcdn.githack.com; img-src 'self' https://rawcdn.githack.com; frame-ancestors 'self'; form-action 'self'; upgrade-insecure-requests; block-all-mixed-content
referrer-policy: no-referrer-when-downgrade
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-frame-options: sameorigin
x-xss-protection: 1; mode=block

It seems to be already behind CloudFlare.

1 Like

Right, one problem is that the headers passed to cloudflare are not especially cache-friendly. e.g. in the above cloudflare marks the homepage as “dynamic”.

2 Likes