Questions tagged [http-caching]
18 questions
6
votes
2 answers
Nginx: Optimizing server response time for a HTTP cached website
I have a website with all of the pages served from nginx’s http cache and rarely invalidated or expired.
The average total page download size is around 2 MB
But despite being a static site with no funny logic my server response is around a second…

Quintin Par
- 4,373
- 11
- 49
- 72
5
votes
0 answers
Client-side caching when using CSP with nonces in nginx - how do you use weak caching validators/etags?
I'm using nginx's expires directive; its etag directive as well as the Last-Modified header (if I understand correctly) are on by default.
In order to allow specific inline JavaScripts when using restrictive Content Security Policy (CSP) headers…

Christian
- 151
- 3
3
votes
0 answers
What is the solution to caching vs using a CSP nonce? I've been searching for a while, and haven't found it
I've never seen a good answer to this dilemma, and I've been searching high and low. It seems it is a choice between using a nonce and caching, you can't have both. Really bad choice!
We're told 'unsafe-inline' is a really bad choice in CSP, and yet…

jamminjames
- 71
- 7
2
votes
1 answer
Caching Chromebooks updates: on premise caching from non proxy-configured client?
Before even attempting to setup something that wouldn't work, I'd like to understand if the following configuration has a logic.
Basically we want to stop Chromebooks to steal bandwidth on updates.
Google suggests to setup a local web caching server…

Riccardo
- 253
- 1
- 3
- 13
1
vote
2 answers
Nginx: Refresh cache only if file has changed - possible?
I'm using nginx as a reverse proxy and for caching.
Currently the cache for location "/test" will be renewed every 2 hours:
"proxy_cache_valid 200 302 301 304 2h;"
Is it possible to only renew cache if a file has changed?
Thank you!

varlog
- 23
- 2
- 6
1
vote
2 answers
Serving a static website with nginx. Response time over 600 milliseconds. What’s wrong?
I serve a wordpress blog with nginx http cached to over 99% of the requests with a cache lifetime of 2 days. Here’s a webpage from the site. The webpages have quite a few images and therefore lazy loaded. The average size of the page is just one 1…

Cherian
- 791
- 1
- 6
- 13
1
vote
2 answers
CDN: Synchronizing cache across edge machines
I built a cheap CDN for my static website based on nginx’s HTTP caching.
Context. Here’s are some parts of my cache configuration:
proxy_cache_key "$scheme://$host$uri";
proxy_cache_valid 200 301 302 1200d;
I have one origin machine and around…

Quintin Par
- 4,373
- 11
- 49
- 72
1
vote
1 answer
How to tell nginx to honor backend's cache? uWSGI
There's a similar question but solution there doesn't work for me.
We have nginx and uWSGI ad backend. We need nginx to cache the backend response according to what is in the response header.
For example, I run curl -I…

Putnik
- 2,217
- 4
- 27
- 43
1
vote
1 answer
RewriteRule with flag [L] stopping caching?
I use server management software plesk with apache and nginx. I set in apache and nginx a expired header for javascript files for one year. That's working. I can see one year for "expires" in header.
Now I want access javascript and php files with a…

user706420
- 113
- 4
1
vote
0 answers
Apache: Setting response headers based on the existence of multiple response headers
We are attempting to enforce a set of non-cache headers in cases where a reverse proxy does not return any cache headers, in an effort to allow independent backend developers to set headers as they please, but fall back to a safe option. However, my…

Johan Karlberg
- 11
- 2
1
vote
1 answer
How To Use Wget Command To Check Server Cache Settings
I'm having trouble with a server side cache with an OpenLiteSpeed server. I've tried the following .htaccess trick to try and turn this cache off. Can you tell me a wget command I can use to test my website to see if caching is disabled properly? I…

ServerChecker
- 1,518
- 2
- 14
- 35
1
vote
1 answer
NGINX cache (same URL) first returns MISS to all Chrome, Curl and Wget
I have a nginx cache proxy that gets content from an apache origin server.
I make requests from curl, wget and Chrome to verify the cache response. Problem is that, for same URL, I always get a MISS first time in each separate client.
I would expect…

adrianTNT
- 1,077
- 6
- 22
- 43
0
votes
2 answers
How to cache video streams (transparently?)
The basic situation:
There are multiple schools connected to a country wide network. (Some thousand schools.)
We need to deliver e-learning content to them using a network that was created specifically for these schools. There are POPs in different…

nagylzs
- 759
- 3
- 12
- 23
0
votes
1 answer
What does this block of varnish code do?
I have this code in varnish config and not sure what it do!
This config will cache or not my client requests? what is wrong with it?
sub vcl_backend_response {
if (beresp.status != 200) {
return (pass);
}
set…

Morteza
- 3
- 2
0
votes
0 answers
Does the missing of header `Set-Cookie` break Nginx proxy_cache?
I have a Nginx proxy server for a Node.js service which reads multiple files and generates a response. I want Nginx to add basic caches for me:
upstream my_http_servers {
server 127.0.0.1:7001;
}
proxy_cache_path /var/cache/nginx-combo…

jiyinyiyong
- 101
- 2