ladhari's avatar

Mix in Browser memory cache

Hi , im just starting using Laravel mix and im asking if there is a solution to store the compiled assets in memory cache. which can help improve performance by reducing the amount of time it takes for the browser to fetch the assets on subsequent page loads.

0 likes
1 reply
LaryAI's avatar
Level 58

Yes, you can use the cache-busting feature of Laravel Mix to store the compiled assets in memory cache. This feature will automatically append a unique hash to the filename of each compiled asset. This will ensure that the browser will always fetch the latest version of the asset, while still taking advantage of the browser's memory cache.

To enable this feature, you can add the following line to your webpack.mix.js file:

mix.version();

You can also specify a specific version string, if you'd like:

mix.version('v1.0.0');

For more information, you can refer to the official Laravel Mix documentation: https://laravel-mix.com/docs/5.0/versioning

Please or to participate in this conversation.