When JavaScript is inside external .js file it's cached on the browser.
Is it possible to do the same with JS inside tags on HTML page?
No.
Alright a little insight of what you're asking for.
Imagine the script tag's content is cached. What would be the name of it? How the browser would identify? Alright somehow it manages to do that. But then comes the real question:
What would you benefit from that? You have no access to the browser's cache so you need to send the same inline script tag with every request as it can be in the cache or not.
To sum up, it is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With