web-push-libs / web-push-php

Web Push library for PHP
MIT License
1.7k stars 295 forks source link

Can I encrypte the same payload once then use it ? #403

Closed typeoo closed 3 months ago

typeoo commented 3 months ago

Hi, Let's say I want to send one payload to 1000 users, can I encrypte it before passing to Subscription::create ? I aim to reduce the sending time. Thanks.

Gugu7264 commented 3 months ago

Hi,

Since the encryption of the payload is done using the user public key, it is not possible to encrypt only once, apart if you're sending the notification a thousand times to the same user.