Stale files in public folder with incremental builds #35479
Unanswered
amalitsky
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, folks! Gatsby all the way!
I'm running incremental production builds by caching and restoring
.cache
andpublic
folders to speed-up my production 4.x gatsbyjs builds.It appears that
public
folder preserved through multiple (and somewhat different) gatsbyjs builds might contain stale files, i.e. multipleapp.[hash].js
andframework.[hash].js
files. Probably more than that but I didn't explore it further.As I understand it, most of gatsbyjs users deploy websites by uploading
public
folder to the production server. Stale files (I'm assuming here) aren't referenced byindex.html
(nor any other relevant files) and normally won't get downloaded by the user.However, they will be uploaded to the server (potentially slowing down the upload), and will sit there taking space and potentially preserving (and, at least theoretically, exposing) unwanted information (for undetermined period of time).
Looks like at this moment the only way to make sure that
public
folder has only relevant files is to build the website from scratch.Is it something worth looking into or at least mentioning in docs? May be something is messed up in my setup?
My use case:
I'm working on a tool analyzing the structure of
public
folder by searching for js, css, font files presumable loaded byindex.html
on website instantiation.Website team provides a set of globs like
"@(webpack-runtime|framework|app|commons|711)-*.js",
and the tool prints the list of files found along with their sizes as a comment on every PR.Kind of a cheap website initial load snapshot to assess the approximate size of the initial load and structure of the files (to notice smth gone or added unintentionally).
index.html
itself is usually included into the report but is not parsed - globs are static and are defined by the user.I tried to remove all files of interest before the incremental build but that didn't work. Sometimes I will get info There are no new or changed html files to build message and my
index.html
file won't get generated.Thank you
Alex
Beta Was this translation helpful? Give feedback.
All reactions