I need to make asynchronous page requests on every page load using AJAX, the idea being that a function in my module is called even when pages are cached.
The only documentation I've been able to find (Drupal 7) is for form handling using AJAX and handling links.
How do I call a module function from a custom AJAX request? Would I just implement hook_menu() and write a custom ajax request or is there a better way of doing this in Drupal 7?