# Caching authentication requests?

**URL:** <https://www.ruby-forum.com/t/caching-authentication-requests/224666>\
**Category:** NGINX\
**Created:** [November 21, 2012, 5:07am UTC](https://www.ruby-forum.com/t/caching-authentication-requests/224666 "2012-11-21T05:07:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 21, 2012, 5:07am UTC](https://www.ruby-forum.com/t/caching-authentication-requests/224666/1 "2012-11-21T05:07:32Z")

</div>

I want to use something like auth PAM but this seems to cause a PAM  
conversation for every request and that is slower. Is there a way to  
cache  
a successful authentication so that an authentication happens only once  
or  
every so many seconds?

---

<div class="post-metadata">

**Author:** ![djczaski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@djczaski](https://www.ruby-forum.com/u/djczaski)\
**Post date:** [December 4, 2012, 12:15am UTC](https://www.ruby-forum.com/t/caching-authentication-requests/224666/2 "2012-12-04T00:15:46Z")

</div>

I asked this question awhile ago but got no responses. I guess that  
means  
its either majorly stupid or completely obvious. I’m running on a  
beaglebone and when I enable something like auth\_pam the number of  
requests  
I can handle drops from about 500 per second to about 30 which isn’t  
suitable. Any kind of point would be help.

Posted at Nginx Forum:

> **[Re: Caching authentication requests?](https://forum.nginx.org/read.php?2,233054,233534#msg-233534)**
>
> I want to use something like auth PAM but this seems to cause a PAM conversation for every request and that is slower. Is there a way to cache a successful authentication so that an authentication happens only once or every so many seconds?...
