Skip to content

Commit

Permalink
Fix: cache better
Browse files Browse the repository at this point in the history
  • Loading branch information
djpiper28 committed Mar 4, 2024
1 parent f41ce7e commit fd72488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions game-source/scenes/player_character/player_character.gd
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func _on_player_did_move(new_pos):
var obj = BoxObject.instance()
obj.transform.origin = Vector2(i["contains"]["coordinate"][0], i["contains"]["coordinate"][1])
obj.fetch_url = "https://hack.djpiper28.co.uk/cache/kubeImageById/" + i["contains"]["Kube"]["id"]
print("https://hack.djpiper28.co.uk/cache/kubeImageById/" + i["contains"]["Kube"]["id"])
OtherObjects.add_child(obj)
pass

Expand Down
6 changes: 3 additions & 3 deletions kube_cache/server/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type Server struct {
Metrics *metrics.Metrics
}

// 24 hours
const cacheControlHeader = "max-age=86400, public"

func New(metrics *metrics.Metrics, database *model.Database, ai *aiStuff.KubeAi) *Server {
return &Server{Database: database, Ai: ai, Metrics: metrics}
}
Expand Down Expand Up @@ -104,9 +107,6 @@ func (s *Server) GetKube(c *gin.Context) {
s.Metrics.IncrementCacheHits()
}

// 24 hours
const cacheControlHeader = "max-age=86400"

func (s *Server) GetKubeRecipe(c *gin.Context) {
id1 := c.Param("id1")
id2 := c.Param("id2")
Expand Down

0 comments on commit fd72488

Please sign in to comment.