Home / Function/ Test_CacheNoStoreDirective() — fiber Function Reference

Test_CacheNoStoreDirective() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

middleware/cache/cache_test.go lines 2590–2606

func Test_CacheNoStoreDirective(t *testing.T) {
	t.Parallel()
	app := fiber.New()
	app.Use(New())
	app.Get("/", func(c fiber.Ctx) error {
		c.Set(fiber.HeaderCacheControl, "no-store")
		return c.SendString("ok")
	})

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

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

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free