Laravel: offline?

I want my web application (which was built using laravel) to work offline ... but I could not figure out how to do this!

I use the "application cache" for static files, but I don’t know exactly how to handle the dynamic side of the application.

The application uses a database in which I assume that I need to use localStorage? (from what ive is reading online so far)

Im basically just looking for someone to point me in the right direction, as I struggle to find a lot online to configure Laravel to use offline

Thanks Dave

+4
source share
1 answer

You can only have a static site offline using appcache. You cannot do this with laravel.

If you want to move data to localstorage and have a semi-dynamic website, you must completely change your architecture. Let me outline a possible approach:

A one-page web application written in javascript (using a framework such as ExtJs) that connects to the backend as a web service that provides access to the database (you can write it with laravel).

When you are connected to the server, you can upload data to localstorage. When you are offline, you can continue to work with data. When the client reconnects, you need to synchronize the changes with the server.

+2

Source: https://habr.com/ru/post/1570499/


All Articles