is changing an environment variable require redeployment?
Answered
Ghost ant posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Ghost antOP
Do I have to trigger deploy when changing/add an environment variable?
Answered by joulev
on vercel: yes
if you self-host via
if you self-host via
next start
: yes if that's a NEXT_PUBLIC
variable, likely no otherwise8 Replies
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
on vercel: yes
if you self-host via
if you self-host via
next start
: yes if that's a NEXT_PUBLIC
variable, likely no otherwiseAnswer
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
but to be 100% sure, it's best to always redeploy on env var change if possible
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Ghost antOP
I have to redeploy
But when redeploying can I check the “use existing building cache†checkbox? Or the building cache doesn’t include the environment variables?
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
yes
you can check the use existing cache
it's not related to env vars
though of course, if it somehows falls into some obscure edge case and your site still misbehaves, you can redeploy again with cache disabled. i doubt this can ever happen though