Caching objects served from PHP

I have a server set up with nginx and PHP-FPM, running a framework that
essentially sends all requests for content to PHP, which then serves it
based on ACL rules. This includes images and other static content.

What I am trying to figure out is how I can get nginx to cache such
objects to avoid the call to PHP for identical data, ie. a static image
that hasn’t changed.

Since all these calls are essentially dynamic, and often the image
objects won’t have easily identifiable extensions, I’m not sure how I
might go about caching them.

I could put Varnish in front of nginx and have it do the caching but
that would not allow caching of HTTPS traffic.

Suggestions welcome!

Posted at Nginx Forum:

Check out fastcgi_cache:

Brian A.