Skip to content

Commit db005a6

Browse files
author
sw33tLie
committed
add caching to remaining pages
1 parent f4a4304 commit db005a6

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

website/pkg/core/apipage.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ func apiPageHandler(w http.ResponseWriter, r *http.Request) {
1212
http.NotFound(w, r)
1313
return
1414
}
15+
w.Header().Set("Cache-Control", "public, max-age=86400")
1516
PageLayout(
1617
"API - bbscope.com",
1718
"Public API documentation for bbscope.com. Access bug bounty scope data programmatically.",

website/pkg/core/contact.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func ContactContent() g.Node {
6363

6464
// contactHandler handles requests for the /contact page.
6565
func contactHandler(w http.ResponseWriter, r *http.Request) {
66+
w.Header().Set("Cache-Control", "public, max-age=86400")
6667
PageLayout(
6768
"Contact Us - bbscope.com",
6869
"Get in touch with the maintainers of bbscope.com.",

website/pkg/core/core.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ func programsIndexHandler(w http.ResponseWriter, r *http.Request) {
652652
http.NotFound(w, r)
653653
return
654654
}
655+
w.Header().Set("Cache-Control", "public, max-age=86400")
656+
655657
ctx := context.Background()
656658
slugs, err := db.ListAllProgramSlugs(ctx)
657659
if err != nil {

website/pkg/core/docs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func docsHandler(w http.ResponseWriter, r *http.Request) {
9999
http.NotFound(w, r)
100100
return
101101
}
102+
w.Header().Set("Cache-Control", "public, max-age=86400")
102103
PageLayout(
103104
"Documentation - bbscope.com",
104105
"Find out how bbscope.com can help you find new bugs",

0 commit comments

Comments
 (0)