- Can I use this bundle with Laravel instead of Symfony?
- No, this bundle is specifically designed for Symfony 2.8/3.x and won’t work with Laravel. Laravel has its own asset management solutions like Laravel Mix or Vite. For Laravel, consider using Webpack or Vite’s built-in asset hashing instead.
- What Laravel version does this bundle support?
- This bundle does not support Laravel at all—it’s a Symfony bundle. Laravel uses Composer but has a different architecture. For Laravel, explore packages like `laravel-mix` or `vite-laravel` for asset versioning.
- How do I configure custom paths for busters.json or the web directory?
- You can override default paths (busters.json and web directory) by configuring the bundle in Symfony’s `config.yml`. Use the `ajaxray_gulp_buster` section to specify custom locations, such as `busters_json_path` or `web_dir`. Check the bundle’s documentation for exact syntax.
- Will this bundle work with Symfony 5 or 6?
- No, this bundle is built for Symfony 2.8/3.x and lacks compatibility with newer versions. For Symfony 5/6, use Symfony’s native `AssetMapper` or migrate to Webpack Encore. A fork or major rewrite would be needed for compatibility.
- What happens if gulp-buster fails to generate busters.json?
- If `busters.json` is missing or invalid, the Twig filter `|with_buster_hash` will append `?v=no-buster-hash-found` to asset URLs. This ensures your app doesn’t break, but you’ll need to debug your Gulp workflow to regenerate the file.
- Does this bundle support dynamic asset paths (e.g., uploaded files)?
- No, the bundle only works with static assets referenced via Symfony’s `asset()` helper. Dynamic paths (e.g., uploaded files) won’t receive cache-busting hashes. For those, consider manual hashing or alternative solutions.
- How do I integrate this with Laravel’s asset management?
- You cannot integrate this bundle with Laravel directly. Laravel uses its own asset pipeline (e.g., Laravel Mix, Vite). For Laravel, use `mix-manifest.json` or Vite’s asset hashing instead of gulp-buster.
- Is there a performance impact when using this bundle in production?
- The bundle adds minimal runtime overhead. The primary performance cost is parsing `busters.json` during Twig template compilation, but this is negligible for most applications. Ensure your Gulp workflow efficiently regenerates the file.
- What alternatives exist for cache busting in Symfony 4/5/6?
- For modern Symfony, use `AssetMapper` (built-in) or Webpack Encore (if using Webpack). For Node.js-based solutions, consider `vite-plugin-symfony` or `webpack-asset-manifest`. These are more maintainable than legacy Gulp setups.
- How do I test this bundle in a CI/CD pipeline?
- Ensure your CI pipeline runs Gulp to generate `busters.json` before deploying. Add a step to verify the file exists and is valid. If missing, your Twig templates will fall back to `no-buster-hash-found`, which may break caching.