Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

How to cache js/css request containing a question mark? (1 reply)

$
0
0
Following nginx configuration in a server block can cache js and css files with "js" or "css" as the end of the url.

location ~ .*\.(js|css)?$ {
expires 7d;
}

But it can't cache request such as:

http: //example.com/jquery.js?ver=1.11.3&build=1

or

http: //example.com/style.css?ver=4.3&build=1

Any way to cache cs/jss files above? Or cache files based on the file type of request instead of file name?

Viewing all articles
Browse latest Browse all 7229

Trending Articles