0

I have set up a Python WSGI script that queries a MySQL database. This works correctly the first time. However, after I update the MySQL data, the script returns the old data instead of the new, and I'm not sure why. My Apache configuration doesn't have caching enabled and neither does the MySQL database. If I run the python file directly I get the new MySQL data. If i restart Apache then i also get the new MySQL data. I think I'm missing something simple. Any tips?

2
  • "However, after I update the MySQL data, the script returns the old data instead of the new, and I'm not sure why" " If i restart Apache then i also get the new MySQL data. I think I'm missing something simple. Any tips?" Sounds like WSGI has caching?.. The problem with caching how to notify the application cache is outdated vs the database version/data... MySQL does not really have a method for that native, PostgreSQL on the other hand has NOTIFY/LISTEN statementsi believe for MySQL there was a UDF (User-Defined Function) that simulated that.. Commented Feb 22, 2019 at 15:17
  • @RaymondNijland Sounds interesting. Do you know of a way to force the WSGI script to always query the data again? The query load will be low so I have no use for caching anything.
    – Kasper
    Commented Feb 22, 2019 at 15:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.