Questions tagged [http-caching]
Eliminate the need to send HTTP requests in many cases, and eliminate the need to send full HTTP responses in other cases, by storing web content closer to where it is consumed.
506
questions
0
votes
1
answer
9
views
HTTP Cache-Control header max-age vs max-age, must-revalidate
I want to find difference between max-age alone and max-age with must-revalidate in Cache-Control header.
I did verification on chrome with both of these.
max-age=10 - It means that the response is ...
0
votes
0
answers
8
views
Webservice request seen in wls acess logs but not in the application logs
We have a soap webservice (written in java) that is hosted on weblogic in a clustered setup of two managed server nodes. We have a webserivce client calling our webservice inside a while loop and the ...
1
vote
0
answers
32
views
Redis wait for key to be cached in GET request
I have two REST end-points
POST request, this request does some long running task and fills the key-value pair in the cache.
GET request this gets the data from the cache corresponding to a ...
1
vote
0
answers
23
views
video element sends multiple network requests
I have a video element with a mp4 source
<video src="https://dh2jw0564x0cd.cloudfront.net/projects/6a30cb01-4414-4c50-ac7e-c2d9ac30358d/assets/videos/1646314487232_Big_Buck_Bunny_1080_10s_1MB....
1
vote
0
answers
37
views
Java HttpClient is not returning latest data from API
I'm running this code in Idea 2020.1 with Java 11 (of course!)
String gitApiPrUrl = "https://bitbucket.myserver.com/rest/api/1.0/projects/PRJ/repos/my-repo/pull-requests";
...
0
votes
1
answer
20
views
flush() and evictAll() not working for okhttp3 cache
I am accessing TestRail's API which has a 180 Req/min rate limit,
I am using okHttpClient for accessing it
To keep a count of a count of requests I am using okhttp cache
After every 180 Requests, I ...
1
vote
1
answer
34
views
Cache-Control: max-age=0 with stale-while-revalidate value?
what happens if the max-age is zero but stale-while-revalidate has a value?
example: Cache-Control: max-age=0, stale-while-revalidate=60
will the stale-while-revalidate be taken into consideration at ...
0
votes
0
answers
26
views
HTTP Header Vary - Order of values
We serve files for our websites to which we add CORS headers. The Vary header is required for cache management at the CDN and browser level.
So the question: is there any importance in the order of ...
0
votes
0
answers
29
views
HTTP-caching long search requests?
I seek for a solution to request a resource identified by possibly a long string (>8k) and let browser/proxy cache the response.
It is a Chrome-extension javascript fetch() search request (thus ...
0
votes
0
answers
31
views
Angular Service Worker , 302 found (From service worker). This affects Google ouath2.0 sign in using passportjs and Nodejs
I Have attached 2 images.
First Image is the very fist time when I load the website where the service-worker is registered. There are 2 arrow mark that shows 302 found and sets the cookies of session ...
-1
votes
1
answer
124
views
Symfony returning HTTP 304 locally, but HTTP 200 for matching ETag in production
Due to a heavy API call taking upwards of 20 seconds, I have enabled computation of ETag for that resource and pre-compute the ETag before doing any heavy DB work to be able to return early. This ...
0
votes
0
answers
26
views
PHP caching image https request
I have a very high I/O load on the server which causes 500 error many times per day while the CPU/RAM usage is basically non exsitent:
the main work of the server is serving images and videos. I'll ...
0
votes
1
answer
130
views
HTTP cache invalidation with API Platform and AWS CloudFront
I am trying to implement a HTTP cache invalidation with API Platform and AWS CloudFront and as I can read in API Platform documentation:
Support for reverse proxies other than Varnish can easily be ...
0
votes
2
answers
39
views
How to add providers, service and interceptor only for gift card module in angular?
I am implementing caching only for gift card module and I have created http-cache.service and cache interceptor.When I add the service in app.module.ts it works but I need to implement this separately ...
2
votes
1
answer
112
views
Saving the response cache to the server in Net 5
As in Net MVC, I want to save the response cache to the server (it's called outputcache), but there is no such feature in Net Core or Net 5. I couldn't find an alternative method. Thank you in advance....
1
vote
1
answer
42
views
How to influence OkHttp cache usage?
You can add a cache to an OkHttpClient which will work according to the various cache-related HTTP header like cache-control:
val okHttpClient =
OkHttpClient.Builder().apply {
cache(Cache(...
1
vote
0
answers
231
views
Force use of HTTP Cache with fetch
I'm trying to use the HTTP Cache for something simple, but I can't get it to work.
I'm using the following options for fetch().
fetch('test', {
cache: 'force-cache',
headers: {
...
1
vote
0
answers
91
views
"mini-css-extract-plugin" every time injects a new number in main.js file on each build which changing contenthash number of main.js unnecessarily
I am using webpack 5, and using contenthash for the main.js file. But my main.js file gets a new hash number on every build even if there is nothing changed in my application. When I compared two main....
1
vote
2
answers
132
views
Delete cache of specific XHR call
I have a XMLHttpRequest that does a GET request:
const xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "myapi/getThing", true)
Normally, the response stays the same so the ...
2
votes
2
answers
471
views
Difference in JSDelivr URL with & without "latest"
I went to GitHub issues to raise a support ticket but thought of asking the question first to avoid noise.
This is what the docs says-
Omit the version completely or use "latest" to load ...
0
votes
1
answer
264
views
Appending hash to js filenames vs Cache-Control: no-store
I was reading this answer about how you can append the hash of a resource, such as a JS or CSS file to the filename, so that your browser only downloads it if it's changed, otherwise a cached version ...
0
votes
1
answer
73
views
Which Cache-Control header values are used by client/server?
I'm trying to understand which values for Cache-Control are to be used in the request and which are to be used in the response.
This is a good answer, but it doesn't mention if you should use those ...
0
votes
1
answer
52
views
Symfony 4 HTTP Cache Headers not same in profiler and browser
For a website development, I try to use Symfony 4 HTTP cache described in documentation.
I created an CacheKernel called in index.php like this :
namespace App;
use Symfony\Bundle\FrameworkBundle\...
0
votes
0
answers
34
views
Wanted to know for how much time will Javascript files gets cached
Recently we have added a new javascript function which is called in one of our jsp file and when for the first time we have deployed the ear file with new js file , I was getting an error as "...
0
votes
0
answers
61
views
Apache Virtual Host Reverse Proxy Specific URL: How to correctly cache on local server and client?
I posted this question on the Apache httpd-users mailing list a week ago, no response there. Since then, I've done a bit more work, so I hope I can get some help here, thanks!
In my Apache Virtual ...
0
votes
0
answers
69
views
How to disable caching for specific image tag in electronjs?
I can disable caching in electron like
const { app } = require ("electron");
app.commandLine.appendSwitch ("disable-http-cache");
But this will disable cache in whole app. I dont ...
1
vote
1
answer
323
views
Can you manually set etag and last-modified on Azure blobs?
For redundancy and scale, I'm manually copying blobs to multiple Azure storage accounts globally. These accounts make up multiple 'origins' in an origin-group on the CDN. Thus, when a request comes ...
1
vote
1
answer
398
views
Varnish default grace behavior
Have some api resources that are under heavy load, where responses are dynamic and to offload the origin servers we are using Varnish as a caching layer in front. The api responds with cache-control ...
0
votes
0
answers
104
views
Getting HTTP 304 with Cache-Control: no-cache
I have an angular application deployed on Amazon S3. The web content is served via a Cloudfront distribution. The issue I am facing is that after one session, the application doesn't load and I keep ...
0
votes
0
answers
196
views
iframe sandbox is not caching my JS script
I can't seem to cache my JS files.
A simple test:
index.html
<iframe src="iframe.html" sandbox="allow-scripts"></iframe>
iframe.html
<!DOCTYPE html>
<html ...
1
vote
1
answer
52
views
How can I use Rails' HTTP caching helpers with an `updated_on` timestamp?
I'm working on a new Rails 6 API app (to serve both a React.js front end and other services) that, for historical reasons, shares a backend MySQL database with two other applications that have existed ...
1
vote
0
answers
68
views
Resource cached with max-age=0
I have a resource that is served with the following headers:
Cache-Control: private, max-age=0
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/javascript;charset=utf-8
Date: ...
0
votes
1
answer
36
views
Cache resource for some time and then validate it using HTTP caching
Considering that the server responds with the following headers:
Cache-Control: public
Expires: <EXPIRATION DATE>
ETag: <HASH VALUE>
Both <EXPIRATION DATE> and the <HASH VALUE>...
1
vote
2
answers
389
views
AEM Dispatcher (4.3.3) always returning 200 instead of 304 (Apache 2.4.6)
I have configured ETags (using ACS Commons ETag support) on my AEM server and disabled ETag on Apache. But once the file gets cached on the Dispatcher, Apache always returns 200 with response body ...
1
vote
0
answers
107
views
nginx gzip - Caching
In the nginx config, I have enabled gzip compression on and I have not enabled any caching headers.
By default, whether nginx compress only the first client request and store the compressed files in ...
0
votes
1
answer
40
views
why browser sends only 1 request for 4 image tags?
I noticed a strange behavior.
There are 4 img tags on html pages but only one http get request goes in network panel .
why is this behavior ?
I thought even if there are 4 same resource request ...
1
vote
1
answer
30
views
Browser not using cached data
Edit: this was all due to a typo in Cache-control max-age setting, used a colon instead of an equal sign.
In my web application, I use socket.io to display images dynamically to clients, based on live ...
0
votes
1
answer
19
views
How is pouchdb website so fast ? What caching mechanism used on the website
Just a random question but would like to know the underlying caching technique.
How is pouchdb website https://pouchdb.com/ so fast, on the first request it takes time to load but after that when we ...
1
vote
1
answer
107
views
Cache issue - Refresh page (F5 button) to see modified content
I’m using FileCache in my cache component. In my controller, I’m using :
[
'class' => 'yii\filters\HttpCache',
'only' => ['view'],
'etagSeed' => function ($action, $params) {
...
2
votes
1
answer
353
views
Varnish ban is added but old object is returned
I'm using varnish in front of a tile server to cache mapbox tiles. To remove old tiles, I intended to use bans to effectively remove a large number of cached tiles. My problem is that varnish still ...
1
vote
1
answer
302
views
Does Heroku have reverse proxy cache?
I've made a simple app that sets Cache-Control: public, immutable, max-age=3600 in response headers. This app is purposely slow(sleep 2) to reproduce the issue.
My goal is to understand whether I can ...
0
votes
2
answers
2k
views
How to prevent HTTP caching of REST calls in browser?
I have a bunch of REST APIs which send cache-control as public, only-if-cached, max-stale=2419200, max-age=60
max-age=60 makes sure that if the client sends an identical API request, the client picks ...
4
votes
0
answers
51
views
Async http requests with ETag caching
I'm currently using Requests with CacheControl in my project, and am trying to migrate to an async approach.
There seem to be lots of great options out there for making async http requests. httpx, ...
0
votes
1
answer
297
views
Caching not stored using Microsoft.Extensions.Caching.Memory in DOT NET
I'm using Microsoft Extensions Caching Memory, but it is not storing data on cache.
My code:
public class MyMemoryCache<TItem>
{
private MemoryCache _cache = new MemoryCache(new ...
2
votes
0
answers
94
views
How to configure http cache policy on an Azure CDN (Premium Verizon) enpoint with storage origin?
We have an Azure CDN profile with Premium Verizon pricing tier. In this profile we have 2 CDN enpoints. One of them has custom origin type, which refers a web app. Second one has a storage origin type....
2
votes
1
answer
156
views
Cross-site attack using browser cache (will it work?)
Scheme of the attack: Attacked site makes a request with cookies (but without Vary: Cookie HTTP header), the browser caches a response, attacking site makes the same request (but without cookies ...
0
votes
0
answers
2k
views
CloudFront returns cached error response despite Cache-Control: no-cache header and minimum TTL of 0
I am building a SPA with the frontend hosted by S3 and the backend served by Lambda and API Gateway. I am trying to use CloudFront to sit in front of both S3 and API Gateway in order to use the same ...
0
votes
0
answers
66
views
How to properly serialize an SSLSession?
Let's say I want to save some HTTP response for the purpose of caching (into disk or memory). The response has an optional SSLSession property that is only present if the client initiated an HTTPS ...
1
vote
1
answer
812
views
Browser caching request/response without any Cache-Control header
I am experiencing a browser cache issue with a SPA web app and REST APIs backend. I can reproduce it on Firefox and Safari with the developer tools opened: I made sure that cache is NOT disabled.
When ...
1
vote
1
answer
793
views
Determine if an image is cached in browser (either memory or disk cache) before displaying the image?
For lazy-loading visualization, I'm attempting to apply a fade-in animation style class only to images that have not been cached in the browser.
To determine if an image was previously loaded and ...