max age with nginx/passenger/memcached/rails2.3.5

孤街醉人 提交于 2019-12-04 17:26:24

I think you're right that this is a problem with your max-age regex.

You're matching against this pattern: ^.+.(jpg|jpeg|gif|png|css|js|swf)?([0-9]+)?$

Because you have question marks ("this part is optional") after both parenthesized sections, the only mandatory part of the regex is that the request URI have at least two characters (.+.). In other words, it's matching pretty near every request to your site.

This is the pattern we use: \.(js|css|jpg|jpeg|gif|png|swf)$

That will match only requests for paths ending with a dot and then one of those seven patterns.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!