Skip to content

Commit

Permalink
Use subdirectory instead of hyphen for cache epoch
Browse files Browse the repository at this point in the history
Simplifies backend's cache-control header logic a bit if we keep everything in js/
The epoch is now a word so we can put easter eggs in there
  • Loading branch information
GarboMuffin committed Aug 20, 2024
1 parent 9eb1121 commit c4d12b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const htmlWebpackPluginCommon = {
APP_NAME
};

// Change this number to bypass all old HTTP caches
const CACHE_EPOCH = 2;
// When this changes, the path for all JS files will change, bypassing any HTTP caches
const CACHE_EPOCH = 'gleba';

const base = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
Expand All @@ -50,8 +50,8 @@ const base = {
},
output: {
library: 'GUI',
filename: process.env.NODE_ENV === 'production' ? `js-${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js',
chunkFilename: process.env.NODE_ENV === 'production' ? `js-${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js',
filename: process.env.NODE_ENV === 'production' ? `js/${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js',
chunkFilename: process.env.NODE_ENV === 'production' ? `js/${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js',
publicPath: root
},
resolve: {
Expand Down

0 comments on commit c4d12b2

Please sign in to comment.