Skip to content

A demo on how pages can use local storage to store almost all it's content, thereby reducing its weight to a fraction on second pageview

Notifications You must be signed in to change notification settings

morten-olsen-archive/localStorage-Caching-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client-Side Caching

This is a proff-of-concept based of my site morten.olsen.io, which stores almost everything in the users localStorage, so it doen’s have to be send again. It does this by inlining all resources (scripts and styles), so the entire page can be send as one reqest. It then stores all cacheable items in the page, with a name, version and a type. The server side keeps track of which client has what resources using a session cookie, and if the client does not have a resource, it is inline. If the client has it, the resource becomes a meta tag, which the client then replaces with the actual content.

I will not write to much about the code, since i have tried to explain everything it does in comments.

About

A demo on how pages can use local storage to store almost all it's content, thereby reducing its weight to a fraction on second pageview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published