Skip to content
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

Optimisation codes #29

Merged
merged 6 commits into from
Oct 17, 2022
Merged

Optimisation codes #29

merged 6 commits into from
Oct 17, 2022

Conversation

qfdk
Copy link
Contributor

@qfdk qfdk commented Oct 15, 2022

Hey,

I read the code source and i fixed some warning message when compile the project.
Then i checked quickly the redis and i think we can do it better :)
To serialize some data in key is not a good idea, actually some shot data will be serialized in the KEY and in the VALUE. JSON.stringify will be called twice in the getCache function. With the user growth, the KEY may be long than 1kb (if the object is large enough)

Before:
image

After:
image

Cordialement,
qfdk

src/pages/dashboard/[subdomain]/editor.tsx Outdated Show resolved Hide resolved
src/pages/dashboard/[subdomain]/settings/css.tsx Outdated Show resolved Hide resolved
src/pages/dashboard/[subdomain]/settings/general.tsx Outdated Show resolved Hide resolved
src/pages/dashboard/[subdomain]/settings/navigation.tsx Outdated Show resolved Hide resolved
src/queries/page.server.ts Show resolved Hide resolved
@qfdk qfdk requested a review from DIYgod October 17, 2022 06:56
@DIYgod DIYgod merged commit 425e9e2 into Crossbell-Box:dev Oct 17, 2022
@DIYgod
Copy link
Member

DIYgod commented Oct 17, 2022

Changes to the key will invalidate SSR - because the key needs to be the same on both the client and the server.

I've reverted back in 4475ffe

@qfdk
Copy link
Contributor Author

qfdk commented Oct 18, 2022

Changes to the key will invalidate SSR - because the key needs to be the same on both the client and the server.

I've reverted back in 4475ffe

I'm so sorry to hear that. It will invalid SSR, if i have some time i will re work on it. If i under standard the logic of code, we try to read the data in the cache, if data doesn't exist, we save the data in the cache. the data is the input data.

zsakvo pushed a commit to zsakvo/xLog that referenced this pull request Apr 9, 2023
zsakvo pushed a commit to zsakvo/xLog that referenced this pull request Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants