-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Varnish cache BAN on update #536
Conversation
|
||
NGINX.purgeMany urls >>= \case | ||
Left err -> return $ openLeft err | ||
Right _ -> return $ Right appId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire section will feel much cleaner when we switch to Rescue
fission-web-server/library/Fission/Web/Server/Internal/NGINX/Purge/Types.hs
Outdated
Show resolved
Hide resolved
Now that https://github.com/fission-suite/infrastructure/pull/73 is deployed, we can test that this works! |
Rebased on top of #547 |
You can really tell when I'm debugging stupid typos on staging by number of close commits 😛 |
@walkah this is updated with |
Oops! I had swapped it out to test something else... put it back now! |
Confirmed that BAN is accepted over curl 👍 I haven't been able to test it on our domains yet because... I'm currently bumping into a problem with the message we get from the remote I thought I could just push this over the line quickly, but no such luck. It's late here, so I'm going to look at it in more depth tomorrow 🌅 |
Okay I have the code working. It was a mix of that changed response from IPFS a while back, but then I was treating a numeric field as a string for... reasons? To make iterating on that kind of thing easier, I've moved the Possibly worth noting that the BAN can be pretty slow. My testing here today has quite a few over a minute, often hovering around 90 seconds after the upload completes on a barebones HTML file. I'm not sure if we can make that more aggressive? |
@walkah both ☝️ and... Also just merged another PR. Rebasing... 👇 |
Talked it through with @walkah The performance hit on write with the Varnish cache makes us nervous. We're going to wait and see what comes out of improving our IPFS setup directly first. We still have this code around if we want to add our own caches for larger users with immutable data (which we're currently throwing paid AWS caches in front of) |
Backported the important parts |
Server Logs
I'd show more, but it's kind of hard to capture in screenshots ("Here it an app before, and here it is after a push!").
Setting Expectations
Because of the way Varnish bans work, it can often take about a minute to actually cache bust. The end result is a refreshed page, you just sometimes have to be patient.
If the cache purge fails, we log and continue. It doesn't seem worth reporting a 502 over, since our worst case is that a page will at worst appear to update slowly and we can always manually cache bust. We'll see these in Sentry if they start to pile up.