dev1234
dev1234

Reputation: 5716

how to cache static html elements in a web page?

I would like to know how to configure a website to cache static elements of html pages?

I have heard this is automatically done by the browser/server but thinking is it a good practice to use meta tags to do the caching

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" /> 

Upvotes: 0

Views: 531

Answers (1)

Ardavan Dejpanah
Ardavan Dejpanah

Reputation: 106

The meta cache control tag allows Web publishers to define how pages should be handled by caches. They include directives to declare what should be cacheable, what may be stored by caches, modifications of the expiration mechanism, and revalidation and reload controls.

The allowed values are:

Public - may be cached in public shared caches

Private - may only be cached in private cache

no-Cache - may not be cached

no-Store - may be cached but not archived

Upvotes: 1

Related Questions