Questions tagged [cache-control]
12 questions
5
votes
1 answer
Nginx does not update max-age
If I make a request to a Nginx-proxy server configured to cache an upstream I get the following response headers:
{'content-length': '13200000', 'x-cache-status': 'MISS', 'server': 'nginx/1.9.9', 'connection': 'keep-alive', 'cache-control':…
olif
- 165
- 6
3
votes
1 answer
Nginx not adding expires headers to fonts, not changing mime types
I have the following location block in my server block in /etc/sites-available/example.com:
location ~* \.(ttf|woff|woff2|eot|mp4|css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
and this under…
geochanto
- 157
- 9
2
votes
1 answer
Is it possible to use .htaccess to instruct browsers to cache google analytics?
When I run Google PageSpeed Insights I get the following optimization suggestion.
When I click the Leverage browser caching link it sends me to a page that recommends I use Cache-Control or ETags.
Setting up Cache-Control with .htaccess should be…
DR01D
- 350
- 2
- 11
2
votes
1 answer
Nginx cache-control / expire headers will just not work
I've searched everywhere for a working answer to this issue, but none of the answers seem to work. I'm also sorry for the super long post but I just need to ask for help on this. I've tried to be as detailed as possible.
I have an nginx webserver…
Grady
- 31
- 5
1
vote
0 answers
Nginx reverse proxy ignores cache headers
I'm using nginx as a load balancer. here is the simplified version of my nginx config file.
upstream myUpstream {
server server1.com;
server server2.com;
}
server{
location / {
proxy_pass https://myUpstream;
}
}
to leverage…
Kibo
- 111
- 5
1
vote
1 answer
add_header 'Cache-Control' working only without location context
I've installed nginx/1.10.3 (Ubuntu) and changed the original config file so that it is only slightly different at the top of the http context:
http {
add_header 'Cache-Control' 'no-cache';
and this is working. I will see 'no-cache' in the…
sorry
- 11
- 1
- 3
1
vote
1 answer
Nginx: Leverage browser caching for remote resources (images)
There are some images in one site of mine which are hosted to a remote server.
I haven't figured out yet how to set Cache-Control to remote sources.
For local files I'm using:
location ~*…
Skeptic
- 191
- 1
- 1
- 6
0
votes
2 answers
cache-control when using mod_cache and mod_pagespeed
I'm using mod_pagespeed with mod_cache.
When mod_pagespeed is off and mod_cache is off I see the following header:
cache-control:public,max-age=7200,must-revalidate
When mod_pagespeed is on and mod_cache is off, I see the following header on the…
DD.
- 3,024
- 10
- 34
- 50
0
votes
1 answer
Correct Apache2 AddType directives for caching fonts
I'm using apache 2 and have set caching directives as follows in the virtual servers conf file:
Header set Cache-Control "ETag, public"
This seems to be working ok apart…
1cloud
- 1
- 1
0
votes
0 answers
Understanding AWS CloudFront Cache Policy for dynamic web pages
I am working on an e-commerce website, where users can buy/sell products (the website is dynamic)
I have created the following CloudFront distribution with the following Behaviors:
As you can see I have 2 types of Responses:
Images: I want the…
Hooman Bahreini
- 486
- 6
- 14
0
votes
1 answer
Nginx expires directive with a variable
I am trying to set a dynamic expires header. This is basically my config:
# http context
map $request_uri $expires_time {
default -1;
*.js max;
}
server {
# server_name/proxy_headers/listen/ssl
location / {
expires…
TheCommoner282
- 103
- 4
0
votes
2 answers
Cache response with nginx and browser, but not CloudFlare
My backend application sends Cache-Control headers so that NGINX and the browser can cache responses.
I would like CloudFlare to not cache these responses. This is because they may have non-public information and while NGINX is cookie-aware when…
Cyral
- 101
- 2