Tuesday, June 25, 2024
HomeGolangHow does browser caching presently work? - Getting Assist

How does browser caching presently work? – Getting Assist


There are recordsdata in my web site (.css, .js, .html) which are going to alter continually however on the identical time there are numerous others (with the identical extensions talked about above) that may all the time be static so I wish to inform the browser which recordsdata it’s allowed to cache. How do I do it utilizing Go?

Then again, I learn that browsers all the time cache .html recordsdata, if that’s true, how the hell are dynamic web sites going to work? that might power to make use of plenty of javascript and wouldn’t enable the usage of strategies reminiscent of templates. It’s value mentioning that I learn such data in previous posts and I couldn’t discover present data, however my intuition tells me that presently any browser caches .html recordsdata, am I proper?

Static pages are rendered as they’re by Go.
Static pages with dynamic knowledge the place the info is handed to the template to {{.}} and rendered by Go.
Absolutely dynamic pages is often constructed by Javascript and rendered by the browser.

And there are pages rendered in Go and elements of the content material is up to date utilizing Javascript and innerHTML.

That’s how I interpret it. However the time period “dynamic” is floating.



1 Like

That is my case, so ought to I fear in regards to the browser caching the .html?

Browser is caching the pages to reinforce the velocity subsequent time you load the identical content material. What do you are worried about? Usually caching is an efficient factor. Therefore I exploit Cloudflare to extend the cache additional…

Cache is helpful however not if the content material modifications on the server facet.

The cache will then all the time be old-fashioned.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments