Welcome! Log In Create A New Profile

Advanced

Avoid cache on zero-bytes-returned?

March 13, 2013 10:20AM
I have a case where a user requires authorization to retrieve content.
Ngnix correctly returns the tomcat's 401, and then the user attempts
authentication.

However, if the user fails to authenticate, tomcat returns a 200 but
zero bytes returned. This comes through nginx as a cache-miss,
status=200, 0 bytes returned.

Unfortunately, if the user tries again, even if he/she is successful,
the 200 result is cached for my 10min cache setting for
200-results...thus, even a correct login will not return the content for
at least 10min due to the cached, zero-byte page.

Is there a way to leave my default caching enabled, but tell nginx to
NOT cache zero-byte results? If the correct content is available in the
cache, I want it returned without going to the back end, but in my case
(at least), a zero-byte result for a status=200 is not valid.

Thanks for any tips or tricks!
-AJ

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx-1.3.14

Maxim Dounin March 05, 2013 09:56AM

Re: nginx-1.3.14

Kevin Worthington March 06, 2013 08:40PM

Avoid cache on zero-bytes-returned?

aweber March 13, 2013 10:20AM

Re: Avoid cache on zero-bytes-returned?

Jonathan Matthews March 13, 2013 10:42AM

Re: Avoid cache on zero-bytes-returned?

aweber March 13, 2013 11:06AM

Re: Avoid cache on zero-bytes-returned?

Jonathan Matthews March 13, 2013 11:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready