Nginx Reverse Proxy Caching

Sathish Kumar satcse88 at gmail.com
Sun May 12 01:40:07 UTC 2019


Hi Team,

Is it better to enabling caching on upstream or on Nginx.

Added to Nginx

add_header Cache-Control "no-cache";

ETag on;

gzip off;

proxy_ignore_headers Cache-Control;


Is it the right way to enable caching on a web application. Upstream server
is a Jetty application server.

On Fri, Feb 15, 2019, 8:25 PM Sathish Kumar <satcse88 at gmail.com> wrote:

> Hi All,
>
> Is it possible to enable gzip and etag to solve caching problem.
>
> On Thu, Feb 14, 2019, 10:00 AM Sathish Kumar <satcse88 at gmail.com wrote:
>
>> Hi All,
>>
>> How can I achieve caching html files only for this location context
>> /abc/* and not for other context path.
>>
>>
>> On Thu, Feb 14, 2019, 7:26 AM Sathish Kumar <satcse88 at gmail.com wrote:
>>
>>> Hi Peter,
>>>
>>> Thanks, I am looking for the same solution but to enable only for html
>>> files.
>>>
>>> On Thu, Feb 14, 2019, 2:02 AM Peter Booth via nginx <nginx at nginx.org
>>> wrote:
>>>
>>>> Satish,
>>>>
>>>> The browser (client-side) cache isn’t related to the nginx reverse
>>>> proxy cache. You can tell Chrome to not cache html by adding the following
>>>> to your location definition:
>>>>
>>>> add_header Cache-Control 'no-store';
>>>>
>>>> You can use Developer Tool in Chrome to check that it is working.
>>>>
>>>>
>>>> Peter
>>>>
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Feb 13, 2019, at 11:56 AM, Sathish Kumar <satcse88 at gmail.com> wrote:
>>>>
>>>> Hi All,
>>>>
>>>> We have Nginx in front of our Application server. We would like to
>>>> disable caching for html files.
>>>>
>>>> Sample config file:
>>>>
>>>> location /abc/ {
>>>>          proxy_pass http://127.0.0.1:8080;
>>>>     }
>>>>
>>>> We noticed few html files get stored in Chrome local disk cache and
>>>> would like to fix this issue. Can anybody help, thanks
>>>>
>>>> _______________________________________________
>>>> nginx mailing list
>>>> nginx at nginx.org
>>>> http://mailman.nginx.org/mailman/listinfo/nginx
>>>>
>>>> _______________________________________________
>>>> 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/20190512/bf07950b/attachment.html>


More information about the nginx mailing list