Home / Function/ Test_CacheHeuristicFreshnessAddsWarning113() — fiber Function Reference

Test_CacheHeuristicFreshnessAddsWarning113() — fiber Function Reference

Architecture documentation for the Test_CacheHeuristicFreshnessAddsWarning113() function in cache_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  e8df4557_9d99_b975_811a_1226e6dcac25["Test_CacheHeuristicFreshnessAddsWarning113()"]
  8453a087_9678_fe96_1b20_2d125b6f8656["cache_test.go"]
  e8df4557_9d99_b975_811a_1226e6dcac25 -->|defined in| 8453a087_9678_fe96_1b20_2d125b6f8656
  style e8df4557_9d99_b975_811a_1226e6dcac25 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/cache/cache_test.go lines 2373–2397

func Test_CacheHeuristicFreshnessAddsWarning113(t *testing.T) {
	t.Parallel()

	app := fiber.New()
	app.Use(New(Config{
		Expiration: 2 * time.Second,
	}))

	app.Get("/", func(c fiber.Ctx) error {
		c.Set(fiber.HeaderCacheControl, "public, max-age=60")
		return c.SendString("body")
	})

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, cacheMiss, resp.Header.Get("X-Cache"))

	resp, err = app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, cacheHit, resp.Header.Get("X-Cache"))

	for _, w := range resp.Header.Values(fiber.HeaderWarning) {
		require.NotContains(t, w, "113", "warning 113 should not be present for explicitly fresh responses")
	}
}

Subdomains

Frequently Asked Questions

What does Test_CacheHeuristicFreshnessAddsWarning113() do?
Test_CacheHeuristicFreshnessAddsWarning113() is a function in the fiber codebase, defined in middleware/cache/cache_test.go.
Where is Test_CacheHeuristicFreshnessAddsWarning113() defined?
Test_CacheHeuristicFreshnessAddsWarning113() is defined in middleware/cache/cache_test.go at line 2373.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free