SetIsFallbackImage sets the Fallback-Image header to indicate that the fallback image was used.
()
| 51 | // SetIsFallbackImage sets the Fallback-Image header to |
| 52 | // indicate that the fallback image was used. |
| 53 | func (w *Writer) SetIsFallbackImage() { |
| 54 | // We set maxAge to FallbackImageTTL if it's explicitly passed |
| 55 | if w.config.FallbackImageTTL <= 0 { |
| 56 | return |
| 57 | } |
| 58 | |
| 59 | // However, we should not overwrite existing value if set (or greater than ours) |
| 60 | if w.maxAge < 0 || w.maxAge > w.config.FallbackImageTTL { |
| 61 | w.maxAge = w.config.FallbackImageTTL |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // SetExpires sets the TTL from time |
| 66 | func (w *Writer) SetExpires(expires time.Time) { |
no outgoing calls