A
A
Andrei2018-05-17 10:36:27
Nginx
Andrei, 2018-05-17 10:36:27

Is it possible to save dynamic PHP and JS pages to static ones on the server?

Do you think it is possible to use this type of acceleration for opening dynamic pages?
There are nginx, php, mysql, JavaScript.
In the browser, you open this goodness not very quickly - up to 5-10 seconds.
Is it possible in some way to save pages opened in the browser as static, and then reuse them, say in nginx as static sites?
Maybe there are utilities for this? Or something homemade, like running a selenium script periodically, which in the browser will save pages to the nginx directory. And he will already open them as static.
Reviewed a bunch of generators from this page: https://www.staticgen.com/
But this is a bit different, because. they do not know how to work with php pages that receive data from the database.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Aksentiev, 2018-05-17
@ngelik

There is a cache in nginx It's
not a problem to make a cache in php
Static sites and their generators have nothing to do with it at all.

V
Vitaly, 2018-05-17
@rim89

In the browser, you open this goodness not very quickly - up to 5-10 seconds.

with SQL everything is all right?
if so, then you need to look towards caching, for example https://www.phpfastcache.com/

D
Dmitry, 2018-05-17
@dimkabelkov

First determine the reason for the slow return of data from the server,
1) the network is not very good, which is unlikely
2) the problem is in the code
- recursions, loops and others
- slow queries in sql, possibly incorrect data organization, are there any indexes, how is the selection
- if you work with files, then it can eat a lot of CPU time
- pictures are not generated on the body? watermarks and others

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question