membphis commented on a change in pull request #1153: feature: support for 
proxy caching plugin based on disk.
URL: https://github.com/apache/incubator-apisix/pull/1153#discussion_r392666263
 
 

 ##########
 File path: lua/apisix/plugins/proxy-cache.lua
 ##########
 @@ -0,0 +1,259 @@
+--
+-- 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 ngx_re = require("ngx.re")
+local tab_insert = table.insert
+local tab_concat = table.concat
+local string = string
+local io_open = io.open
+local io_close = io.close
+local ngx = ngx
+local os = os
+local ipairs = ipairs
+local pairs = pairs
+local tonumber = tonumber
+
+local plugin_name = "proxy-cache"
+
+local schema = {
+    type = "object",
+    properties = {
+        cache_zone = {
+            type = "string",
+            minLength = 1
+        },
+        cache_key = {
+            type = "array",
+            minItems = 1,
+            items = {
+                description = "a key for caching",
+                type = "string",
+                pattern = [[(^[^\$].+$|^\$[0-9a-zA-Z_]+$)]],
+            },
+            default = {"$host", "$request_uri"}
 
 Review comment:
   The response data of the HEAD and GET methods are different.
   
   So I think we better add `method` to the cache key.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to