nginxnginx-locationw3-total-cache

Location parameter containing string NGINX


We use W3 total cache plugin to minify our javascript in WordPress. The plugin makes 'virtual files' like 'https://tinki.nl/?w3tc_minify=c7035.js'. I want to cache those file in our upstream NGINX server. Normally those files would be in the wp-content directory but now they are not.

1) Can I somehow configure W3 total cache to put those files in a directory in stead of a virtual file? 2) If not, how can I catch these files in a location in the NGINX config? All files contain the string 'w3tc_minify'. The problem is that it is not the filename that contains the string but the URL parameter so the following does not work:

location ~ w3tc_minify { bla bla}


Solution

  • I found out that there was an entirely different cause to this problem. W3 total cache does not update the minified source somehow. That is why the filenames of the minified files stay the same. Normally, different file names would be generated and there would not be a caching issue with NGINX.