Skip to content
Advertisement

Somehow my Fask API returns me old values

In debug:

I run ng serve on my angular project, make the request and receive the updated values

In production

I update de files of the API and the angular project, make the request and receive old data. If I open the API link in a new tab I get the updated values, even the files in the server are acting like that but if I open their links, even when deleted, I still can access it.

Even when I deleted all the values in a table I still get outdated data

Both production and debug access the same database

Technologies:

  • Front-end: Angular
  • Back-end: Flask

What I’ve tried:

  • Set @@AUTOCOMMIT to 1
  • Change cache in order to not be saved

Here is the code of one endpoint:

JavaScript

Caching system

this is added after every request

JavaScript

Advertisement

Answer

Solved by removing cache

My thought:

Since in development I’ll have to make the same request many times, I removed cache from the Angular project and will only put it back when it is in production.

Thanks for the help

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement