Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

[BUG] A http.headers.static.response in inserted into all responses instead of just static responses #115

Closed
victor-sudakov opened this issue Nov 12, 2021 · 3 comments · Fixed by #125
Assignees
Labels
B-bug Bug: bug, exception
Milestone

Comments

@victor-sudakov
Copy link

Roadrunner 2.5.3 is configured to insert the Cache-Control: "public, max-age=700" header into static responses. Instead, it inserts it into all responses.

HTTP session (the second Cache-Control header is generated by the PHP app):

GET /auth/testing/with_sleep/1001/ HTTP/1.0
Connection: Keep-Alive
X-VAS-BENCH: ApacheBench
Host: XXXXXXXXXXXX
User-Agent: ApacheBench/2.3
Accept: */*

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2021 07:17:50 GMT
Content-Type: application/json
Connection: close
Cache-Control: public, max-age=700
Cache-Control: no-cache, private
Vary: Accept-Encoding
X-Powered-By: RoadRunner

rr config snippet:

http:
  address: 0.0.0.0:8060
  middleware: ["headers", "static", "gzip"]
  pool:
    num_workers: 30
    max_jobs: 700
    supervisor:
      exec_ttl: 60s
  headers:
    response:
      X-Powered-By: "RoadRunner"
  static:
    dir: "public"
    forbid: [".php"]
    calculate_etag: true
    response:
      Cache-Control: "public, max-age=700"

@victor-sudakov
Copy link
Author

The documentation at https://roadrunner.dev/docs/http-static is ambiguous: what level should "static" be on, http.static or http.headers.static or http.address.static?

@rustatian rustatian transferred this issue from roadrunner-server/roadrunner Nov 13, 2021
@rustatian rustatian added the B-bug Bug: bug, exception label Nov 13, 2021
@rustatian rustatian added this to To do in RoadRunner via automation Nov 13, 2021
@rustatian rustatian added this to the 2.6.0 milestone Nov 13, 2021
@rustatian rustatian added this to SPRINT 2021-11-15 [IN_PROGRESS] in RoadRunner Sprints Nov 13, 2021
@rustatian
Copy link
Member

@victor-sudakov I have updated the documentation. If it's not clear from the docs, please, feel free to inspect the full reference https://github.com/spiral/roadrunner-binary/blob/master/.rr.yaml

@rustatian rustatian moved this from SPRINT 2021-11-15 [DONE] to SPRINT 2021-12-25 [IN_PROGRESS] in RoadRunner Sprints Nov 17, 2021
@victor-sudakov
Copy link
Author

@victor-sudakov I have updated the documentation.

Looks clean now!

RoadRunner automation moved this from To do to Done Nov 18, 2021
@rustatian rustatian moved this from SPRINT 2021-12-25 [IN_PROGRESS] to SPRINT 2021-11-15 [DONE] in RoadRunner Sprints Dec 1, 2021
@rustatian rustatian removed this from SPRINT 2021-11-29 [DONE] in RoadRunner Sprints Jan 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B-bug Bug: bug, exception
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants