janusec icon indicating copy to clipboard operation
janusec copied to clipboard

Customize the content that Janusec will cache

Open Anthony-vhost opened this issue 3 years ago • 4 comments

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 !

Anthony-vhost avatar Feb 08 '22 02:02 Anthony-vhost

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) ?

zhyale avatar Feb 08 '22 12:02 zhyale

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 !

NgHuuAn avatar Feb 12 '22 06:02 NgHuuAn

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.

zhyale avatar Feb 12 '22 11:02 zhyale

Hi,

Its strange, in my case timestamp not updated.

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

NgHuuAn avatar Feb 12 '22 14:02 NgHuuAn