Cache Busting a PWA App via Netlify Function

Hi, my site kurdle.netlify.app is a PWA and I had come up with a good solution to cache-bust new builds that seems to have gone away?

In a netlify function that kicks off when the user first comes to the site I was leveraging the accessible COMMIT_REF environment variable: const { COMMIT_REF } = process.env;

And delivering that in the response, I’m storing that value in local storage so if there is a deviation I can bust the cache of the pwa app. This had previously worked (I swear) and it works for me locally netlify dev but on my deployed site COMMIT_REF is not available

On the built site it looks like these are available in the process.env

AWS_ACCESS_KEY_ID
AWS_DEFAULT_REGION
AWS_EXECUTION_ENV
AWS_LAMBDA_FUNCTION_MEMORY_SIZE
AWS_LAMBDA_FUNCTION_NAME
AWS_LAMBDA_FUNCTION_VERSION
AWS_LAMBDA_INITIALIZATION_TYPE
AWS_LAMBDA_LOG_GROUP_NAME
AWS_LAMBDA_LOG_STREAM_NAME
AWS_LAMBDA_RUNTIME_API
AWS_REGION
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
AWS_XRAY_CONTEXT_MISSING
AWS_XRAY_DAEMON_ADDRESS
LAMBDA_RUNTIME_DIR
LAMBDA_TASK_ROOT
LANG
LD_LIBRARY_PATH
NETLIFY_IMAGES_CDN_DOMAIN
NODE_EXTRA_CA_CERTS
NODE_PATH
PATH
PWD
SHLVL
SITE_ID
SITE_NAME
TZ
URL
_AWS_XRAY_DAEMON_ADDRESS
_AWS_XRAY_DAEMON_PORT
_HANDLER
_X_AMZN_TRACE_ID

is there a best practice to cache-bust a pwa app I’m missing?
Thanks!

I’ll just start incrementing my version in package.json and start referencing that. thanks

The other concern I have is, why do you need to cache-bust? Won’t that cause performance issues?

Also, I really don’t think COMMIT_REF was a variable accessible to functions. It is a build-time environment variable.