drupal-with-nginx icon indicating copy to clipboard operation
drupal-with-nginx copied to clipboard

nginx upload progress D7 module & micro caching

Open raphaelApard opened this issue 10 years ago • 2 comments

Hi, and thank for this drupal nginx conf.

How can i exclude path "filefield_nginx_progress/[upload-id]" from micro cache ? Seems like we can't use regex in map_cache.conf

raphaelApard avatar Dec 22 '14 13:12 raphaelApard

Why do you need that? Do you allow for anonymous users to upload files?

Yes you can add regexes to map.

Just add another map directive and modify the final one like this:

## Make the upload progress path be uncached.
map $uri $no_cache_upload_progress {
    default 0;
    ^/filefield_nginx_progress/.*$ 1;
}

## Combine all results to get the cache bypassing mapping.
map $no_cache_ajax$no_cache_cookie$no_cache_upload_progress $no_cache {
    default 1;
    000 0;
}

perusio avatar Dec 22 '14 19:12 perusio

Thanks, i don't know why, i've got only 1 of 5 requests getting fresh data from filefield_nginx_progress/XXX. 4 others hit X-Micro-Cache (304). I'm connected (as admin). I shoudn't be concern by micro cache as authenticated user ?

Still get hiting micro cache with mapping $no_cache_upload_progress in map_cache.conf.

Thank for your help, i will keep searching how is wrong with my config.

raphaelApard avatar Dec 22 '14 21:12 raphaelApard