Skip to content
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

Emergency website cache control #8340

Merged
merged 7 commits into from
Dec 17, 2024
Merged

Conversation

joewhitsitt
Copy link
Contributor

@joewhitsitt joewhitsitt commented Dec 13, 2024

Relates to #8336

How to test

Using https://emergency.dev.drupal.uiowa.edu/ and https://signage-stage.uiowa.edu/city-iowa-city/downtown-interchange-stop-0001 create hawk alerts and observe the behavior. Ideally alerts and replacement alerts should show up in less than or a little over a minute based on the various timers between the two systems. After an alert is marked as complete, it should fall off the sign in an hour. I've made no change to how signage fetches/displays these.

Then you curl -I the different endpoints (DEV/PROD), you should see a big difference in varnish cache age.

The hope is that cutting Varnish times lower will prevent signs from fetching stale information.

@joewhitsitt
Copy link
Contributor Author

So far, compared to PROD, this is limiting the max-age of the endpoint. Because Drupal-Cache is still a HIT, I think I will remove the attempt at gutting of those. If the node_list does trigger, it should clear this under the 30 sec max-age.

https://emergency.dev.drupal.uiowa.edu/api/active

@joewhitsitt
Copy link
Contributor Author

DEV:

age: 0
via: varnish
x-cache: MISS

PROD:

age: 96571
via: varnish
x-cache: HIT

@joewhitsitt
Copy link
Contributor Author

signage-stage hawk alert endpoint config has been switched to emergency.dev.drupal.uiowa.edu

Testing:

I opened a sign in an anonymous chrome-based browser and didn't touch it.
Created an alert on emergency.dev.drupal.uiowa.edu and set it to published. Less than a minute later It popped up on the sign without any interaction with the window.
I then went into the alert and marked it complete. This removes it from the endpoint, but I am still seeing the alert on the sign. A new alert created will replace it (less than or around a minute), but completing both alerts will keep the latest one showing for an hour. I think this is working as it was originally designed. I don't love it though.

@joewhitsitt joewhitsitt requested a review from a team December 13, 2024 21:23
@joewhitsitt joewhitsitt marked this pull request as ready for review December 13, 2024 21:23
@cory-skeers cory-skeers self-assigned this Dec 17, 2024
Copy link
Contributor

@cory-skeers cory-skeers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested with similar results. Let's get it up to prod.

@cory-skeers cory-skeers merged commit 30fc2e0 into main Dec 17, 2024
2 checks passed
@cory-skeers cory-skeers deleted the emergency_website_cache_control branch December 17, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants