abhiram potluri
abhiram potluri

Reputation: 45

Make my webpage non-cacheable

I have been trying to make my webpage non-cacheable using HTTP Meta tags This is the meta tags that i have written in my HTML page.

meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
meta http-equiv="Cache-control" content="no-cache"

When I analyze my packets through wireshark, I get HTTP 200 message for the first time. But when i extract the page second time, it gives me a HTTP 304 message which I assume means that the webpage is cached.

Can anyone please help me how to make my webpage non-cacheable.

Upvotes: 1

Views: 3274

Answers (3)

Fyodor Soikin
Fyodor Soikin

Reputation: 80880

These tags only affect what the browser does, not the server.

In order to control caching on the server, you should configure your web server and/or your web application, and I cannot help you with that without knowing what they are.

Upvotes: 0

Leo Jiang
Leo Jiang

Reputation: 26193

Use an .htaccess file. Create an .htaccess with the following content or add the following to the end of an existing .htaccess file:

<FilesMatch "\.(html|htm)$">
FileETag None
<IfModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</IfModule>
</FilesMatch>

Upvotes: 2

Matt Cashatt
Matt Cashatt

Reputation: 24228

Try this in your <HEAD></HEAD> section:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

Upvotes: 0

Related Questions