h5bp / server-configs-nginx

Nginx HTTP server boilerplate configs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting "HIT" in the second load only (for everybody)

glinskicwb opened this issue · comments

The config passed the nginx -t, but, for some reason, the cache only HIT after the second time you load the page.

The problem is that this is happening even if the page was already "HIT" by someone else. So everytime someone enters, they get a "MISS" first, never a HIT.

It's not a config error, so this is a server side problem? If so, you can close this as it's not the config's problem.

Thank you for your time.

I'm not exactly sure what you're referring to (At a glance, I don't see the use of a cache in this server config).

But, that sounds like expected behaviour to me. The first request must be a MISS, as there is nothing cached.

If you are expecting the cache to be reused for different users, you should check the cache key you are using, you may have something in there which makes the cache unique for each user.

Thanks for opening this ticket @glinskicwb.
As explained by @Dreamsorcerer (thanks!), H5BP template configuration don't cover cache usage, cache configuration is very linked with the application behind.
Plus, again as explained by @Dreamsorcerer (thanks again! 😉), this is the expected behavior.

If you need more assistance, please refer to your host or your server provider.