-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
duplicates of site.data
in db.json leads to large size
#5260
Comments
|
But it still does after I add the |
Can you provide a reproducible example? |
I'm sorry I'm just now responding to your question. I've uploaded a zip file with examples that can successfully reproduce the problem I'm talking about. The source folder in this zip contains two folders that make |
My friend told me that placing binary files (including images) in the |
reproduce
db.jsonthe data of this may be the related code. (
|
I think you shouldn't put images or other binary files in Data Folders, but in Asset Folders. Of course, we should probably process |
site.data
in db.json leads to large size
It was added in #1969 |
Fixed by #5325 |
Check List
Please check followings before submitting a new issue.
hexo version
to check)Expected behavior
The db.json file should be a reasonable size. (Should it be under 50MB at the very least?)
Actual behavior
But in fact, even though I deleted most of the posts from my blog and kept only one post (the md file was 5KB in size), the resulting db.json was still over 70MB.
I'm not quite clear on why this happened, I didn't have this problem originally either, it seemed to come out of nowhere but I can't remember what I was modifying at the time.
Through my observation, there are a lot of duplicate
_id & data
fields in db.json, such as thesource/_data/avatar/cpen.webp
file, which is recorded more than 100 times in db.json, which takes up a lot of space.This problem caused my
hexo se
andhexo g
to wait quite a long time after theINFO Validating config
step, and I had to runhexo cl
or manually delete the db.json before each command, which clearly defeats the purpose of the db.json file.Is the problem still there under "Safe mode"?
The problem persists even if I add the
--safe
directive.Environment & Settings
Node.js & npm version(
node -v && npm -v
)node version: 18.12.1
npm version: 9.8.1
Your site
_config.yml
(Optional)Hexo and Plugin version(
npm ls --depth 0
)Details
Your package.json
package.json
detail
The text was updated successfully, but these errors were encountered: