fatihbm commented on code in PR #13810:
URL: https://github.com/apache/apisix/pull/13810#discussion_r3793006394


##########
apisix/plugins/query-gateway/cache.lua:
##########
@@ -0,0 +1,455 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local core = require("apisix.core")
+local redis = require("apisix.utils.redis")
+local rediscluster = require("apisix.utils.rediscluster")
+local resty_sha256 = require("resty.sha256")
+local to_hex = require("resty.string").to_hex
+local ngx = ngx
+
+local concat = table.concat
+local lower = string.lower
+local pairs = pairs
+local ipairs = ipairs
+local math_min = math.min
+local table_sort = table.sort
+local tonumber = tonumber
+
+local _M = {}
+
+local HOP_BY_HOP = {
+    connection = true,
+    ["keep-alive"] = true,
+    ["proxy-authenticate"] = true,
+    ["proxy-authorization"] = true,
+    te = true,
+    trailer = true,
+    ["transfer-encoding"] = true,
+    upgrade = true,
+}
+
+local ALLOWED_VARY = {
+    accept = true,
+    ["accept-encoding"] = true,
+    ["accept-language"] = true,
+}
+
+local function sha256_hex(value)
+    local sha256 = resty_sha256:new()
+    sha256:update(value)
+    return to_hex(sha256:final())
+end
+
+local function shared_dict()
+    return ngx.shared["query-gateway-cache"]

Review Comment:
   Fixed. A missing shared dict is now logged once and treated as a cache 
bypass, so cache-enabled routes continue to proxy normally.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to