Add Cache-Control headers on AP endpoints #180
This enables future use of Varnish in front of WriteFreely (see T693 for details).
(By "ActivityPub fetching" I mean requests with the header
This closes T693.
I'm not sure if you did any benchmarks but I did
And with Varnish in the middle but before the pages are cached the transaction times were:
That's just with two iterations of 255 concurrent users.
robjloranger left a comment •
Everything looks good and the cache control header is working as expected on the specified end points.
I also tested response times again using wrk, matt is still just Nginx and rob is with Varnish:
~/c/wrk (master|✔) $ ./wrk -t8 -c1000 -H "Accept: application/activity+json" https://matt.writefreely.dev Running 10s test @ https://matt.writefreely.dev 8 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 475.32ms 187.24ms 1.98s 81.42% Req/Sec 109.66 50.04 272.00 68.52% 7587 requests in 10.08s, 10.51MB read Socket errors: connect 208, read 3752, write 0, timeout 21 Requests/sec: 752.60 Transfer/sec: 1.04MB ~/c/wrk (master|✔) $ ./wrk -t8 -c1000 -H "Accept: application/activity+json" https://rob.writefreely.dev/log Running 10s test @ https://rob.writefreely.dev/log 8 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 268.45ms 169.69ms 1.95s 90.81% Req/Sec 212.60 92.59 630.00 70.68% 15536 requests in 10.09s, 3.40MB read Socket errors: connect 159, read 3170, write 0, timeout 66 Requests/sec: 1539.76 Transfer/sec: 345.50KB
This one supports more concurrent connections, set at 1000 here.
Got it, I just added a case in the subroutine for receive