Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize the content that Janusec will cache #34

Open
Anthony-vhost opened this issue Feb 8, 2022 · 4 comments
Open

Customize the content that Janusec will cache #34

Anthony-vhost opened this issue Feb 8, 2022 · 4 comments

Comments

@Anthony-vhost
Copy link

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
Copy link
Member

zhyale commented Feb 8, 2022

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
Copy link

NgHuuAn commented Feb 12, 2022

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
Copy link
Member

zhyale commented Feb 12, 2022

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
Copy link

NgHuuAn commented Feb 12, 2022

Hi,

Its strange, in my case timestamp not updated.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants