D
D
dimonchu2020-11-26 00:16:32
linux
dimonchu, 2020-11-26 00:16:32

Nginx proxypass cache and php, how to set it up correctly?

A bunch of nginx + apache + php + cloudflare.
Our company has many sites on the same server, and in order for it to somehow hold the load, the cache was enabled on the nginx side, through proxy_cache towards apache. But it happens that some sites "freeze", and when editing content, it returns old data until the cache lifetime has passed (but sometimes the cache is not reset).
Question. How to properly configure the cache so that php at the time of changes requests the current data and caches them already? Any hint is welcome.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sanes, 2020-11-26
@Sanes

Cloudflare is giving away old data.

A
Andrey Gavrilov, 2020-11-26
@thexaver

I would advise you to go to Apache on php fpm, it will be faster

X
xmoonlight, 2020-11-26
@xmoonlight

I don't really understand the question, but maybe it will help.

V
Victor Taran, 2020-11-26
@shambler81

in 99% of cases, it would be more expedient to work with the code of the site itself, this is a fact, improve the caching system, redo the heaviest queries, as a rule, when the project grows, this is not uncommon, and here you can achieve performance much faster than through crutches.
also do not forget that if you do not want to cache part of the site, then make a separate location for this event.
There are also special recommendations individually for each engine.
Also, do not forget that even changing the PHP version can greatly improve the situation. Again, you need to look at what you have, if you are on 5.6 then exactly 100%
and even if you are on 7.0
do not forget that you must also have opcache connected and the configs rebuilt with high quality apache nginx and mysql should also give you a great boost.
up to 50K visitors the site should cope on one server without crutches.
so more introductory
what versions are there for the link to the site (this doesn’t work, you also pay for direct so that I know it)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question