Skip to content

limit image processing on dev enviroment #6548

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env node */

const isDev = process.env.NODE_ENV === "development";
module.exports = {
siteMetadata: {
title: "Layer5 - Expect more from your infrastructure",
Expand All @@ -13,7 +13,8 @@ module.exports = {
},
flags: {
FAST_DEV: true,
PARALLEL_SOURCING: true
PARALLEL_SOURCING: true,
PARALLEL_QUERY_RUNNING: true
Copy link
Member

@M-DEV-1 M-DEV-1 Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LibenHailu could you explain the PARALLEL_QUERY_RUNNING flag? or maybe point me to the docs for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@M-DEV-1 by default gatsby uses single thread to run the graphql quires, It is assumed that this flag helps gatsby to use multiple processes.

gatsbyjs/gatsby#32389

couldn't find it on the latest experiential flag tho here

https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/flags.ts

I have 8-core CPU I saw some increase in CPU usage but I have to double check if the thing is working as expected.

},
trailingSlash: "never",
plugins: [
Expand Down Expand Up @@ -513,7 +514,7 @@ module.exports = {
resolve: "gatsby-plugin-sharp",
options: {
defaults: {
placeholder: "blurred",
placeholder: isDev ? "none" : "blurred",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would placeholder "none" do when we're in dev environment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if the placeholder is set to 'none', Gatsby skips further image processing in development mode. In production, it shows the blurred version until the full image loads.

}
}
},
Expand Down
Loading