Conversation
Notices
-
okay let's see if it caches
- likes this.
-
@jeff Still seeing Pleroma headers and redirect to /notice/. @pwm got it working, ask him for a config. Cute bun btw.
-
@jeff @pwm Don't, those are frontend-specific paths.
-
@mint @pwm i'll cache notice too i guess
-
@jeff @mint full section
```
location /objects {
proxy_cache objects_cache;
proxy_cache_key "$host$request_uri";
proxy_cache_valid 200;
proxy_no_cache $cookie_sessionid;
proxy_ignore_headers Cache-Control;
proxy_set_header Accept application/activity+json;
proxy_pass http://phoenix;
add_header x-cache "$upstream_cache_status from nginx";
}
```
I think I may have some directives that are not exactly kosher but it does what I wanted
-
@jeff @mint The key to making the redirect not happen is to reset the accept header to the one pleroma expects to be coming to it from other AP servers or applications
> proxy_set_header Accept application/activity+json;
pleroma will always give you json if you tell it this, whether in your nginx conf or set on the command line with e.g. curl
-
@jeff @pwm /notice/ only returns either redirect to /objects/ (if requesting activity+json) or the same HTML page with linked scripts as everything else on frontend. Caching it is pointless and might even break things in case of frontend update.
-
@mint @pwm go on.... why?
-
@jeff @pwm Seems to be working now.
-
@pwm @mint okay i circumcised the config snippet so it's kosher
-
@jeff @pwm It should. Saves the trips to database and wasting queue slots for Pleroma's internal webserver replies.
-
@pwm @mint it's not like it'll do anything perf wise tbh
-
@jeff @mint oy vey!
-
@jeff @pwm Inbound (fetching activites by remote instances).
-
@mint @pwm for outbound or inbound federation?
-
@mint @pwm inbound federation queues have been draining fast af before all this tbh
-
@jeff @mint in my case I am doing it to avoid trips across the vpn back to my home server, as my connection has been experiencing up to 20% packet loss lately. Could be placebo, since I didn't measure before and after but it seems to have made things snappy, and I definitely see smoother traffic especially when large accounts like or reply to a post.
-
@pwm @mint no noticable perf impact
-
@pwm @mint so like, this nginx ran the largest open bittorrent tracker which used tls in the god damned world.