Comments (3)
Excellent reply. Thanks for the help...
from bundling.
As a footnote, when I changed from run-time bundling to design-time bundling, everything works fine. So for now, I'll just roll with the design-time stuff.
from bundling.
However, when I use with a bundled script, nothing is added to the URL. See content below.
asp-append-version
is a base ASP.NET Core tag helper attribute, it won't work with bundles produced by this library.
Is there a work around or something built into the bundler for append a version? I want to make sure that users' browsers don't use cached bundles when a new, updated version is available.
Bundle versioning and cache busting is built into the library and supported out of the box. As a matter of fact, cache busting is automatically enabled in Production
environments by default. You can however override this behavior using the EnableCacheBusting
method. E.g. if you want to enable it regardless of the runtime environment, just make an EnableCacheBusting(true)
call on the builder returned by AddBundling
.
It's also worth mentioning that you can also control
- whether hash-based (
UseHashVersioning
) or timestamp-based (UseTimestampVersioning
) versioning is to be used and - whether to append the version to the path (
UseFileNameVersioning
) or query string (UseQueryStringVersioning
) part of the URL.
By default hash-based versions are used and appended to the path part.
One more thing to note: instead of asp-append-version
you can use the bundling-add-version
attribute to override the global versioning settings for individual bundles.
As a footnote, when I changed from run-time bundling to design-time bundling, everything works fine. So for now, I'll just roll with the design-time stuff.
All the above also goes for design-time bundling (in case you configure the bundle services properly and call the InitializeBundling
method as shown in the quick start template project).
In the case of design-time bundling asp-append-version
accidentally works, however I recommend choosing the library's "idiomatic" way of versioning because that provides more control and lets you switch between design-time and run-time bundling easily.
from bundling.
Related Issues (16)
- How to apply transforms to a Bundle like we used to do in Asp.Net MVC 4? HOT 2
- Cannot access node_modules folder HOT 1
- Vuejs HOT 5
- .Net Core 3 issues HOT 2
- Does it work with .NET Framework 4.7? HOT 5
- Using CDN HOT 1
- Question: How to handle client side caching HOT 4
- Tree shaking in EcmaScript HOT 2
- EcmaScript - NullReferenceException when variable is not declared HOT 1
- Render individual includes HOT 8
- Add option for generating source maps
- Issue when script file has been modified outside of Visual studio HOT 5
- Negative number invalid for list HOT 1
- JS: Multiple mobile versions give syntax errors after bundeling. HOT 5
- Are there plans to update bundling tools to target .NET 7? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bundling.