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

VAPID header caching #208

Merged
merged 4 commits into from
Feb 23, 2019
Merged

Conversation

javiermarinros
Copy link
Contributor

@javiermarinros javiermarinros commented Jan 30, 2019

As @ozgurhangisi suggested in #195

Just enabling it with $webPush->setReuseVAPIDHeaders(true); does the trick. Tested in my production environment.

@javiermarinros javiermarinros changed the title Implemented VAPID header caching VAPID header caching Jan 30, 2019
Copy link
Member

@Minishlink Minishlink left a comment

Choose a reason for hiding this comment

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

Looks good! :) Can you mention this in the doc and indicate that it is a tradeoff between security and perf?

@javiermarinros
Copy link
Contributor Author

Done. I would like to point that there is barely no security tradeoff, as the only payload data that changes between invocations to getVapidHeaders() is the expiration timestamp. Maybe this setting could be enabled by default or extend it longer than the flush session (e.g. using the current hour in the cache key, so VAPID headers would be renewed every hour)

Copy link
Member

@Minishlink Minishlink left a comment

Choose a reason for hiding this comment

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

Thanks!

@Minishlink Minishlink merged commit bc465f7 into web-push-libs:master Feb 23, 2019
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