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,293
  • 10
  • 46
  • 72
4
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…
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,293
  • 10
  • 46
  • 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,095
  • 3
  • 23
  • 40
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

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…
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…
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,498
  • 2
  • 14
  • 32
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,007
  • 5
  • 21
  • 41
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
  • 657
  • 2
  • 8
  • 21
0
votes
0 answers

Cloud platforms CDN: is it possible to make specific API request going through CDN caching?

I have encountered many Apps that has a server-side handler with the following features: (1) The App makes "pictures, musics" that needs to be downloaded going through a CDN caching network and therefore the URL to access for example a.jpg will be…
cr001
  • 185
  • 1
  • 7
0
votes
0 answers

Caching 401 response on bad token in nginx njs

In our application whenever a token (that arrives in a header) is invalid - it is practically guaranteed there won't be an exact valid token. So I'm trying to offload the responsibility of responsding 401 to nginx (with or without njs) Trying to…
Boaz
  • 375
  • 1
  • 9
  • 16
1
2