How to make website available offline
Asked Answered
K

6

7

I want to make my website available offline even if the user clears the cache and cookies. Is is possible? Also I am dealing with database. Is is possible to handle databases offline?

Keeney answered 1/2, 2011 at 10:39 Comment(1)
I am thinking of using web sql database but it needs support of sqllite. Is it possible to use mysql at server side, and sqlite at cleint side.Keeney
C
11
  1. A user could store a local copy of a single webpage using Chrome (right click save-as) and it will store all resources (images, css, js) required to fully load the page offline. Other browsers will have similar options.

  2. You can use wget to mirror a whole website for offline browsing.

    wget --mirror --convert-links --html-extension -p http://www.example.com/
    

    of course neither of these options will handle database driven elements of your site/page.

  3. If you want to mock a database or dynamic elements of a page offline then Google Gears is probably the closest to what you are looking for but I think it was deprecated by Google last year.

Caribou answered 1/2, 2011 at 10:45 Comment(1)
Google Gears is no longer available, but it's still possible to make websites available offline using Service Workers.Herringbone
B
7

If your users have modern browsers, try HTML5 Application Cache.

References:

Overview - http://www.html5rocks.com/en/features/offline

Demo - https://jonathanstark.com/labs/app-cache-7/

Tutorial - https://www.html5rocks.com/en/tutorials/appcache/beginner/

Article - http://grinninggecko.com/developing-cross-platform-html5-offline-app-1/

Beaverbrook answered 22/9, 2012 at 5:40 Comment(1)
Your second link is downAlpers
E
2

Checking out websites linked in other answers, a majority of the methods are deprecated.

The best (supported) option to make a website available offline now are Service Workers, with support in all major browsers. You might also want to look into PWAs (progressive web apps), which have some methods to allow for offline operation, including APIs like the Cache Storage API, IndexedDB (for binary data), or WebStorage (to store key/value string pairs).

Eire answered 10/5, 2021 at 19:27 Comment(0)
T
0

No, if your databases are housed online. then you need a internet connection for the PHP/ASP (whatever you're using to deal with DBs) to connect/communicate to the DB's

Tchad answered 1/2, 2011 at 10:43 Comment(1)
(I know this is an old answer, but I make a comment for other user who read this..) Even thought your web app / homepage are create with serverside technologies like php or asp, its still possible to use some of the techniques in the other answers to have an offline model, especially with html5. But there are no "direct" (without work) way to do it. (The database part, need some method for sync when the device come online again, so it can be a tricky thing to do, and there are off cause not live updating, if there are no internet connection!)Several
I
0

For storing data locally and accessing them offline take a look at Gears and Web Storage.

The main problem is what degree of functionality you want to provide with your website. It always requires some work on the client (user) side to "store" aka. save your website offline. You would have to store all your functionality in one page that the user stores (be it a Flash movie or some Javascript-Code).

Iceskate answered 1/2, 2011 at 10:52 Comment(0)
G
0

You can use simple command to download whole website locally with all links working properly.

wget -rk 'http://www.website.com'

For https url you need to add one more property like below :

wget -rk --no-check-certificate 'https://www.website.com'
Gorilla answered 13/4, 2017 at 3:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.