Resource loading require new SSL connection

My domain is: yoursite.com

My web server is (include version):Nginx 1.16.1

The operating system my web server runs on is (include version):Ubuntu 16.04 32

My hosting provider, if applicable, is: Digital Ocean

I can login to a root shell on my machine (yes or no, or I don’t know): YES

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): Latest version (installed on Oct 2019

When loading my site, on any page of it, manifest.json always requiring new SSL connection to download, check my screenshot

Screenshot_1|690x240

This is from GTMetrix screenshot. Checking with Google Chrome resulting the same. Testing other website, manifest json loading normally without requiring new SSL connection. Is there anything I can do to fix this problem?

Thanks

I can’t find anything “wrong” with the coding…

Try changing:
href=/manifest.json
to:
href=https://<yoursite>.com/manifest.json

Should that do the trick: My preferred beverage is :beer: :slight_smile:

I just changed it, not working, still new ssl handshake. Other resource on header loaded properly, only this one, manifest.json on any page, that always requiring new ssl handshake. I don’t do anything weird with Nginx config.

Is there a way to force new ssl handshake for certain resource? I’ll check it on my rig if there’s such thing like that.

Edit, I can only give you tea because the answer is wrong :slightly_smiling_face:

1 Like

I will try harder… LOL

There must be some difference in the handler/handling:

content-type: application/json

has

cache-control: max-age=604800, public

while:

content-type: image/webp
content-type: text/html; charset=utf-8

both have:

cache-control: max-age=3600, public

Care to share?
[your nginx vhost config]

A lot of rule because I’m using W3TC to take care caching and minify

Here’s main nginx.conf

https://pastebin.com/rSY7hAvG

Site conf

https://pastebin.com/YH3ZPd4s

W3TC conf

https://pastebin.com/szjT6rxf

Let me know if you find something weird.

Please show:
include /etc/nginx/mime.types;

any relevant location blocks in:
include /home/xxxxxx/public_html/nginx.conf;

I would try exluding json from gzip:
[the file is kind of small already]

gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel;

Mime types is default, I even never open it :slight_smile:

Here's the content mime types - Pastebin.com

For include /home/xxxxxx/public_html/nginx.conf; is W3TC config W3TC conf - Pastebin.com

I would try exluding json from gzip:
[the file is kind of small already]

Ok, removed

Or we may be completely off target…

Perhaps your main config is limiting the number of files per connection; thus requiring multiple connections.
Simple test:
[let’s not mess with production - lol]

  1. copy the html file to another file
  2. test that new file has the exact same problem
  3. change the order where the json file is loaded [up or down - makes no difference]
  4. restest new modified file
  5. reply with that result

Unless the gzip thing did the trick!
[I’d be surprised]

Perhaps your main config is limiting the number of files per connection; thus requiring multiple connections.

The weird thing is, you might not believe this, at all pages, so there are different counts of resources that get loaded, manifest.json always requires new ssl handshake, and in waterfall chart it's always loaded late, so this json is not always loaded on the same sequence, different counts of images loaded before this.

I'll try to create HTML file with json file moved to bottom.

Try loading manifest.json multiple times in the same file.
[top middle bottom]
That should stress it good.

If it won’t answer the questions directly… we will beat the answers out of it!

  1. Why are you treating json files differently than other files?
  2. Why are you processing other files before the json file?
  3. Why do birds suddenly appear…

If it won’t answer the question directly… we will beat the answers out of it!

Haha, you're right, this is what I often do, pretty tiring though. But can't do anything else since I can't even find this problem on Google. Cursed VPS/site :laughing:

Here's the json at bottom, not loading at all.

Maybe there's requirement manifest json have to be at header?

Before this I also tried adding blabla.json next to manifest.json, only the first json loaded (manifest.json)
Is there rule that on site only allowed 1 json?

Am I missing something?
I don’t see any json file loaded in that test file results.
[blabla.json file has to exist for it to get loaded]

And there’s this gem:
[God only knows what’s inside that cookie jar]
<link rel=https://api.w.org/ href=https://<yoursite>.com/wp-json/>

I just tried disabling my caching plugin, so the file include /home/xxxxxx/public_html/nginx.conf totally empty. Manifest.json still behaving weird.

So NOT caching issue.

Doubt it.

What about:

There don’t really even look close to the same:
-rw-r–r-- 1 root root 141189 Nov 20 00:49 index.html
-rw-r–r-- 1 root root 98170 Nov 20 00:32 test.html

As long as it can “reproduce” the problem…
Let’s continue.

Am I missing something?
I don’t see any json file loaded in that test file results.
[blabla.json file has to exist for it to get loaded]

I tried blabla.json before. Not this one.
Here I recreated it, 2 json, manifest.json and blabla.json, bot at bottom, not loaded
-removed-

2 json, both at top, only 1 loaded

change that link to a gtmetrix link or picture showing the problem

manifest.json and blabla.json both at top, only 1 loaded, manifest.json that stated first

manifest.json and blabla.json both at top, only 1 loaded, blabla.json that stated first
blabla.json requiring new ssl handshake

manifest.json and blabla.json both at bottom, non loaded

multiple manifest.json at super top, top, at body, and footer, only 1 loaded

Sorry, I don’t see an answer.

But I’m still looking…
[always watching… always watching]