cache enhancements

1. support caching bad ks's (expired, logged off, etc)
2. added support for debugging cache issues