Can RR compress (gzip) static content? #1015
-
For example static content such as js or css can be compressed (gzip). It is a good idea to have text-based resources served with compression (gzip, deflate or brotli) to minimize total network bytes. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hey @nitrogenium. Sure, just place http:
address: xxxx
middleware: ["static", "gzip" ] <----------- Request comes from here |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. Before writing the question, I read the documentation, tried to figure it out myself, did a series of tests. No success. Middleware: ["static", "gzip" ] - It works. But only for content which worker has generated. But for static content it doesn't work. My config: version: "2.7"
rpc:
listen: 'tcp://127.0.0.1:6001'
server:
command: "php ./vendor/bin/rr-worker start --relay-dsn unix:///var/run/rr/rr-relay.sock"
relay: "unix:///var/run/rr/rr-relay.sock"
relay_timeout: 60s
logs:
mode: production
level: warning
encoding: json
http:
address: '0.0.0.0:8080'
max_request_size: 256
middleware: ["static", "headers", "gzip"]
uploads:
dir: /tmp
forbid: [".php", ".exe", ".bat", ".sh"]
headers:
response:
X-Powered-By: RoadRunner
static:
dir: /app/public
forbid: [".htaccess", ".php"]
response:
X-Powered-By: RoadRunner
pool:
num_workers: 6
max_jobs: 128
allocate_timeout: 10s
destroy_timeout: 10s
supervisor:
max_worker_memory: 256
exec_ttl: 60s
ssl:
address: '0.0.0.0:8443'
redirect: false
cert: /etc/ssl/certs/selfsigned.crt
key: /etc/ssl/private/selfsigned.key
http2:
h2c: false
max_concurrent_streams: 128
status:
address: '127.0.0.1:8082'
unavailable_status_code: 503
endure:
log_level: error
Request URL: http://127.0.0.1:8080/ But: Request URL: http://127.0.0.1:8080/css/frontend.css I've tried everything I can. |
Beta Was this translation helpful? Give feedback.
-
fixed by: roadrunner-server/http@26882a1 |
Beta Was this translation helpful? Give feedback.
fixed by: roadrunner-server/http@26882a1