Looks like a server issue:
the etag request and response are the same, yet your server send a 200 instead of a 304.
The vary on User-Agent make little sense unless you want to overwhelm the server cache.
That said, when you change the js, you should increment the version in the filename and allow caching in-definitively for that kind of file...
Do you plan to deliver different js code for different users?
HTTP Request
------------
GET /res/js.php?s=dc.min.401.js HTTP/2
Host: storiesonline.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
DNT: 1
Connection: keep-alive
Cookie: sa_pref=*; drk=0; cookie=*; salt=*; lvt=*; stwd=*; solcore=*; sbs=; x=*; selSt=*
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
If-Modified-Since: Fri, 14 Jun 2024 07:55:17 GMT
If-None-Match: "12ff-19015be6288-gzip"
Priority: u=1
HTTP Response
--------------
HTTP/2 200
cache-control:
pragma:
expires:
x-frame-options: SAMEORIGIN
last-modified: Fri, 14 Jun 2024 07:55:17 GMT
etag: "12ff-19015be6288-gzip"
vary: Accept-Encoding,User-Agent
content-encoding: gzip
x-xss-protection: 1; mode=block
content-length: 1879
content-type: application/javascript
date: Mon, 24 Jun 2024 15:37:55 GMT
server: Apache
X-Firefox-Spdy: h2
var req,tags=[],.....