You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/21 09:18:34 UTC

[GitHub] [apisix] tzssangglass commented on a diff in pull request #8119: fix: renew route lrucache when the routes change

tzssangglass commented on code in PR #8119:
URL: https://github.com/apache/apisix/pull/8119#discussion_r1001566792


##########
apisix/plugins/ai.lua:
##########
@@ -132,6 +132,12 @@ local function routes_analyze(routes)
         core.log.info("use ai plane to match route")
         router.router_http.match = ai_match
 
+        local count = #routes + 3000

Review Comment:
   > 2\. is it desirable to recreate cache once the router is rebuilt (a new route is added)?
   
   no, if the router is rebuilt, the cache version(`router.router_http.user_routes.conf_version`) would be changed, so a new request comes in and generates the cache key as old would execute origin router_match and generates new `matched_route`, and cache new `matched_route`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org