When does caching kick in?
It might be a better idea to set a contextual filter on the path. You can still do some tweaking in hook_views_query_alter(), if needed (you can do a lot of things with contextual filters in the ui), but at least views knows by doing that which cache contexts it has to set.