Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official Velocity Web Server documentationWeb Assets and Web Asset Bundles

Web Assets

Web Assets was introduced in VWS 1.1.3 (Washington, March 2026). It is a powerful feature and something I had personally wanted for a long time.

Web Assets is a caching system designed for common libraries frequently used on websites and web applications. Libraries such as jQuery, Vue.js, and React are used everywhere. Instead of searching for the correct URLs or manually downloading them to your web server, you can simply use VWS’s cached version.

Once an asset has been installed into the VWS asset cache, it becomes available to any website hosted by the server. This means that frequently used libraries only need to be downloaded once and can then be reused across multiple projects.

Web Assets are stored in the web-assets directory inside the VWS data folder. Each asset is organised by library name and version, allowing multiple versions of the same library to coexist.

Installing Web Assets

Assets can be installed using the -a command when starting VWS. This command downloads a library from a remote source and stores it inside the Web Assets cache.

vws -a jquery
vws -a react
vws -a vue

VWS includes a large number of built-in presets for common libraries. These presets automatically download the latest supported version of the library and place it into the cache.

After installation, the asset can be referenced directly from your website using the built-in VWS asset path:

<script src="/__vws_asset/jquery/4.0.0.js"></script>

Because the library is served directly by VWS, this avoids dependency on external CDNs and can improve reliability and performance.

Web Asset Bundles

VWS also supports Web Asset Bundles, allowing multiple cached libraries to be combined into a single request. Bundling reduces the number of HTTP requests required to load a page, which can significantly improve page load performance.

A bundle is created by requesting multiple assets within the special __vws_bundle path. Assets are listed in the order they should appear in the final bundle.

<script src="/__vws_bundle/jquery/4.0.0.js,react/18.3.1.js,react-dom/18.3.1.js"></script>

When VWS receives a bundle request, it loads each asset from the cache, concatenates the files together, and serves them as a single response.

Web Asset Bundles are also cached in the order they are defined in, so if you ever use that Bundle again, it can load faster.

The order of libraries in the URL is preserved, ensuring that dependencies load correctly. For example, React must load before ReactDOM, and jQuery must load before many plugins.

VWS automatically determines the correct content type based on the first asset in the bundle. If the bundle contains JavaScript files, the response will be served as JavaScript; if it contains CSS files, it will be served as CSS.

Bundling works entirely at request time and does not modify the cached asset files themselves.

Comments

There are no comments on this page.

New comment

Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.

Comments powered by BalfComment

Feedback 👍
Comments are sent via email to me.