D
D
Dmitry Koldyaev2017-11-16 13:00:59
Nginx
Dmitry Koldyaev, 2017-11-16 13:00:59

How to cache api application?

Now I am writing a front-end application in angular, I load data with ajax, server rendering and everything seems to be fine: the source code has all the data.
Now we need to configure the cache.
It turns out that I have to cache both api requests and the pages on which the data of these requests will be used. Obviously this breaks the whole concept of api apps.
How to deal with it?
@RidgeA
It turns out that when changing one publication, I need to clear the cache
for all these urls:
/api/publication?id=10-- the API itself
/-- the main page
/publications/10-- the publication page itself
It seems that this breaks the whole point of creating api applications.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-11-16
@RidgeA

All api methods need to be allocated to a separate location, for example, in location / api {} and caching can already be configured there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question