I have MVC 4 project and I set Bundle config, then when run the project. Click Show Source on Google Chrome, I see,
Content/css?v=42vVIeLLwfJkSHVR7RjQehV5VVwDvOhprAczcjnTBiU1
Then I test my website performance on GTMetrix. And says me, Remove query strings from static resources for ?v=
How can i solve this problem?
The v
querystring is a dynamic cache buster, a hash of the file contents.
This is great for performance as you can cache the bundle for a year (default) and any changes to the contents will update the cache buster.
It's quite ironic that GTMetrix are reporting against this.
However if you really need to you can remove the hash cache-buster by setting false
for the 2nd parameter of ResolveBundleUrl
.
@BundleTable.Bundles.ResolveBundleUrl("~/Content/css", false)
If this is just to please GTMetrix however, I would refrain from doing this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With