Janusec / janusec

JANUSEC Application Gateway provides secure access, including reverse proxy, K8S Ingress Controller, Automatic ACME Certificate, WAF, 5-Second Shield, CC Defense, OAuth2 Authentication, Global Server Load Balance, and Cookie Compliance etc. JANUSEC应用网关,提供安全的接入,包括反向代理、K8S Ingress Controller、自动化ACME证书、WAF、5秒盾、CC防御、OAuth2身份认证、GSLB负载均衡与Cookie合规等。
https://janusec.github.io/
Other
1.14k stars 263 forks source link

Customize the content that Janusec will cache #34

Open Anthony-vhost opened 2 years ago

Anthony-vhost commented 2 years ago

Hi,

We see that all static files will be cached including application/json make the returned data unchanged (timestamp), is there any way we can customize the content-type that Janusec cached?

Thanks and Regards !

zhyale commented 2 years ago

currently no customization for it, you can tick it off temporarily, I will check this function for json. Would you mind paste the request URL (such as /aaa/bbb.php , without the domain name) ?

NgHuuAn commented 2 years ago

Hi,

I have the same problem with hxxps://domainname/server-healthcheck-api

Data return is json format look like and doesn't change after refresh.

{"data":{"cpu":5.1213145267,"memory":211955712,"ctime":5891.15,"elapsed":264416370,"timestamp":1644671004063,"pid":1,"ppid":0}}

Thanks !

zhyale commented 2 years ago

Hi,

I have the same problem with hxxps://domainname/server-healthcheck-api

Data return is json format look like and doesn't change after refresh.

{"data":{"cpu":5.1213145267,"memory":211955712,"ctime":5891.15,"elapsed":264416370,"timestamp":1644671004063,"pid":1,"ppid":0}}

Thanks !

I create a test web used for the backend server, and enable cache for it, code is here: `package main import ( "fmt" "strconv" "time"

"github.com/gin-gonic/gin"

)

func main() { fmt.Println("Hello, This is a web test.") r := gin.Default() r.GET("/server-healthcheck-api", func(c *gin.Context) { c.JSON(200, gin.H{ "message": "pong: " + strconv.FormatInt(time.Now().Unix(), 10), }) }) r.Run(":8085") }`

The response will chage for each request.

NgHuuAn commented 2 years ago

Hi,

Its strange, in my case timestamp not updated.

To workaround this, i have add ?t= per api request then data not cached :)