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

Data reduction: Send image url instead of image data on search #2

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gurgalex
Copy link

@gurgalex gurgalex commented Oct 11, 2021

The goal of this PR is to reduce duplicate data sent by leveraging the browser's cache facilities.

The bulk of the data sent on pagination is the image data.
with base64 image data
image

I've updated the database to store the raw png that is now sent out over a custom route /<id>/images/battle_sprite.png

The results are stunning
~10x less data sent on every pagination
sending only url
image

Plus, the cache control I've set (maybe nginx is best for this??) means the images are not rerequested on reloads.
Also, the site is now useable on slow connections since the text is viewable while waiting for images to load.

image

Reduces future data usage by a factor of 10 on 100 item paginations
Make site useable on slow connections since text is loaded and load when
they can.

Used cache control to mark the image assets as never changing
@gurgalex gurgalex marked this pull request as ready for review October 11, 2021 22:45
@gurgalex gurgalex changed the title WIP: Data reduction: Send image url instead of image data on search Data reduction: Send image url instead of image data on search Oct 13, 2021
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.

1 participant