playcanvas / playcanvas/engine
Why is getFileUrl not adding hashes for script assets?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Line: https://github.com/playcanvas/engine/blob/main/src/framework/asset/asset.js#L385
This means that scripts won't cache bust like other assets and is causing some issues on CDNs with clients projects.
This code was added about 6 years ago
As a workaround, we've given the clients an engine patch for this function: https://playcanvas.com/project/1047700/overview/asset-fileurl-patch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/framework/asset/asset.js#L385 and inspect how getFileUrl handles script assets versus other asset types. Reproduce or trace the generated script URL, then verify that the URL includes the expected hash for CDN cache busting. The workaround link provides context for the intended behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance, web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100