I am building an app that inserts/updates rows in some of the tables in the Moodle database. The tables are mdl_course_sections, mdl_course_modules, mdl_context and mdl_url. Yes, as you may have guessed, I am trying to script the action of adding a URL to a section minus writing to the logs. After inserting/updating rows to add a URL, correctly (I believe), I could not see the URL, immediately, after doing a browser refresh of the course page. I realized after doing a purge of the whole Moodle website ("Site administration" -> "Development" -> "Purge all caches"), I could see the URL that I intended to add.
Do you have to purge the cache every time you want to view the URL that you intended to add by scripting? (You do not have to purge the cache after manually adding the URL to see the URL.)
Thank you.