Repository navigation
Commit c62e53b
The front Varnish caches anonymous SPARQL queries on their body
The client POSTs every query (the SPARQL 1.1 Protocol's query via POST),
and varnish-frontend passed every POST, so each visitor's views reached
the platform even when the store's own Varnish already held the result:
there a hit is ~2 ms, through the platform ~0.3 s, and in a page's burst
1-4 s. A URL-keyed cache cannot tell two POSTs to /sparql apart, so the
body is cached (std.cache_req_body, up to 64 KB) and hashed into the key
(bodyaccess, which the varnish image ships).
Only reads, and only anonymous ones: application/sparql-query, or a form
with query= and no update=, to /sparql or /ns, without Client-Cert,
On-Behalf-Of or an id_token cookie - the same rule as the GET branch,
since an authenticated response carries the agent's identity. A miss is
fetched as the POST it was. Results are kept for an hour; any write that
passes through bans them all, as the end-user Varnish does for GETs, and
a cached query no longer bans /sparql as if it were a write.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 6aa8346 commit c62e53b
1 file changed
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| 491 | + | |
491 | 492 | | |
492 | 493 | | |
493 | 494 | | |
| |||
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
538 | 558 | | |
539 | 559 | | |
540 | 560 | | |
| |||
576 | 596 | | |
577 | 597 | | |
578 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
579 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
580 | 626 | | |
581 | 627 | | |
582 | 628 | | |
| |||
590 | 636 | | |
591 | 637 | | |
592 | 638 | | |
| 639 | + | |
| 640 | + | |
593 | 641 | | |
594 | 642 | | |
595 | 643 | | |
| |||
602 | 650 | | |
603 | 651 | | |
604 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
605 | 657 | | |
606 | 658 | | |
607 | 659 | | |
| |||
0 commit comments