httpserve

package
v0.0.0-...-9431910 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package httpserve contains constants and utility functions for serving HTTP content.

Index

Constants

View Source
const (
	// MaxCacheControlAge is the maximum age in a cache-control
	// header supported by most browsers. Notably, IE9 will consider
	// as stale resources with a max-age greather than this value
	// (2^31).
	MaxCacheControlAge = int(^uint32(0) >> 1)
)

Variables

View Source
var (
	// MaxExpires is the maximum safe HTTP Expires header value.
	// It represents the UNIX biggest timestamp representable with
	// 32 bits.
	MaxExpires = time.Unix(int64(MaxCacheControlAge), 0).UTC()
)

Functions

func NeverExpires

func NeverExpires(w http.ResponseWriter)

NeverExpires sets the appropriate headers on the given http.ResponseWriter to make the response never expire (in practical terms, it really expires in 68 years).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL