-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assets:clean
task is not cleaning predigested assets with .digest
in the name
#140
Comments
.digested
in the name.digest
in the name
.digest
in the nameassets:clean
task is not cleaning predigested assets with .digest
in the name
Looks like there a brief mention of this in #110 but no (clear) resolution. |
It's a bug. Are you using esbuild and allowing chunking? |
We allow chunking. Not with esbuild but with Webpack. I suppose the bundler doesn’t matter. Are there any attempts at fixing it that I can look at? Or known workarounds? For us, the assets directory grows to 40GB in a month or two and resolving that requires clobbering and precompile with a downtime of couple of minutes — a heavy JavaScript app that is going through a lot of iterations basically. I’m going to test a script tomorrow that would look at the `.manifest.json` and deletes all the files with `.digested` in their name and are not mentioned in the manifest. On 29. May 2023, at 20:10, Breno Gazzola ***@***.***> wrote:
It's a bug. Are you using esbuild and allowing chunking?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I think the problem is caused by #100 which I'm considering reverting as it's causing multiple problems, I just need confirmation. Last question: Do all chunks have the same base name and only differ in the digest? I'm asking because clean is actually working for me, keeping only the 3 most recent versions of each file |
Actually, I just figured it out. Clean is not going to work because each file name is unique due to the digest, and therefore Propshaft cannot group them into "versions" to delete the old ones. I'll have to think a bit about how to handle this (I would also welcome a PR) |
Examples of pre-digested files:
I can look into it sometime to see if I can make a PR. At least, I will try to give a workaround script using the manifest to clear unused assets. |
I'd love to say we could just group them by the name before the digest, but esbuild gives all chunks the same name and that would break it. |
Whenever
rake assets:clean
is run, the assets inpublic/assets
with.digest
in their name are not cleaned at all. This causes assets to accumulate on production and drastic increase in disk usage over time.I realised that this is because of the following:
propshaft/lib/propshaft/output_path.rb
Lines 55 to 60 in 69c285f
The regex ignores all files that have a
. digest
in them.Is this on purpose? or is this a bug?
The text was updated successfully, but these errors were encountered: