-
Notifications
You must be signed in to change notification settings - Fork 61
Add caching to improve the loading speed #101
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR for improving the application loading.
There are few other good concepts that can be used :
- Lazy loading
- Compressing the images
- Updating the latest packages to latest version
- Build optimization flags, production flags in build command
What do you think ?
"installMode": "lazy", | ||
"updateMode": "prefetch", | ||
"resources": { | ||
"files": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good idea to add static images and files in cache memory. But isn't service worker
works with https-server
?
We will love to see it working once we get the surge deployed URL. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shekharrajak I'm glad you asked this. There is a ngsw.json
which manages app's versions. Whenever a developer changes files locally, this file's version changes. Whenever, a user on the client side reloads his page, first only the request for ngsw.json
would be made. If only it's found same, no other requests for files shall be made, else requests for new (or updated) files are made. Hence, an improved loading speed.
Yes, this would work by serving the production build using http-server
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this would work by serving the production build using http-server.
So how did you tested it? I am curious to see the loading speed difference and check this out in http://pr-101-evalai.surge.sh/
Can you test it by changing some content and serve it again ? Offline it would be showing old content and after running the server again and after refreshing the page it should be able to update the changed content.
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
=======================================
Coverage 53.43% 53.43%
=======================================
Files 55 55
Lines 2358 2358
Branches 253 253
=======================================
Hits 1260 1260
Misses 1023 1023
Partials 75 75 Continue to review full report at Codecov.
|
Let's keep it on hold for now. We need to revisit this later for sure before launching v1. |
Enabled Caching to improve the loading speed.
Changes proposed in this pull request: