Hacker News new | past | comments | ask | show | jobs | submit login
If you are using Cloudflare and Chrome, add custom header to see cache hit (kiru.io)
46 points by kiru_io on Jan 23, 2023 | hide | past | favorite | 10 comments



This same thing can be done in Firefox btw. Basically the same process

You can also click a network request in the network tab and select "Edit and resend" to play around with network calls. Firefox also gives you "Use as fetch in console", do performance analysis on specific calls, block certain calls, and some other nifty and often overlooked toys


I'm on the latest version of FF and there's no apparent way for me to add a custom header to the network panel.

How do you do this on FF?


I just checked, out of interest and it was "obvious" for me.

Open the web console:

"Tools > Browser Tools > Web Developer Tools"

Select the networking tab, and hit reload on your current page to get a bunch of requests. Once you do that right-click on a request and select "Edit and Resend".

The left side of the display will now show you basic details of the request, URL parameters, etc.

Scroll down and you'll see the existing headers being used (User-Agent, etc). And keep going to the bottom you'll then see "name" and "value". Those look grey, but are ticked. Enter the values you want to add, and a new "name/value" pair will appear beneath them to let you add another custom header.

Finally click "send" to make the request.

Firefox 109.0 (64-bit), running on Linux for what that's worth.


The question was, how to add a custom header to the table in the Network panel.


For anyone confused, I think the issue here is that the question is about response headers and the reply is about request headers. Everyone keeps saying the word header without this important modifier.


The answer above showed how to add a new header to an outgoing request:

Where the line show "Name" and "value" just enter the name and value of the header you wish to add. Those fields look greyed out, and uneditable, but they are not. When you start entering values a new row appears if you wish to add additional headers to your outgoing request.

If this is not helpful then you'll need to be much more specific in your question.


Might be only available in Firefox Developer Edition


woops sorry about that. Yeah you're right, you can't actually add custom response headers, just pick from the list of response headers they give you

From looking through Bugzilla, it seems there's been quite a few tickets to add this to Firefox and some work on it was even done, but never got merged in due to some existing bugs

Sorry for this misinfo


Good to know, I use the chrome add on Dr. FLARE (https://chrome.google.com/webstore/detail/drflare/pibckhncbj...) to see cached images on sites,


This is really useful, thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: