Need to add expires header conditionally based on mime types

Miguel Clara miguelmclara at gmail.com
Fri Jun 14 04:30:15 UTC 2013


>From what you describe I do think the suggested nginx config is enough...

However maybe you're looking for something like this:

http://stackoverflow.com/questions/14631044/expires-header-based-on-dynamic-content-type-in-nginx

Not really sure if it suits you're needs, but It seems this is what
you're looking for.

You can also find more info on mime type here:
http://wiki.nginx.org/HttpCoreModule#types

Hope this helps,

Mike


On 06/14/13 03:12, Silver Moon wrote:
> yes, i could send out headers from php itself
> but mime based header generation in the webserver itself would make
> things easier.
>
> so finally it is impossible to achieve that ?
>
> On Fri, Jun 14, 2013 at 8:35 AM, Host DL <hostdl at gmail.com
> <mailto:hostdl at gmail.com>> wrote:
>
>     If you handle your js, css and images by php scripts you can use
>     header function to send out Expires and Cache-Control directives
>
>     example:
>
>     <?php
>     header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
>     header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
>     ?>
>
>     _______________________________________________
>     nginx mailing list
>     nginx at nginx.org <mailto:nginx at nginx.org>
>     http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
>
> -- 
> Silver
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130614/14f782b0/attachment.html>


More information about the nginx mailing list