I have a classic ASP page that calls in some other ASP files using Server Side Includes.
I want neither the main file nor the included files to be cached by any browser.
At the moment my main looks something like this:
<%@ Language="VBSCRIPT" %><% Option Explicit %>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires=-1
%>
<!--#include file="scripts1.asp"-->
<!--#include file="scripts2.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>myTitle</title>
<!--#include file="head.asp"-->
</head>
<body>
<!--#include file="body.asp"-->
</body>
</html>
I have only placed the Response.CacheControl, Response.AddHeader, Response.Expires code on the main page and not on the included files.
My questions are:
Do all server side included ASP pages need the
Response.CacheControl
,Response.AddHeader
andResponse.Expires
code that I have used, or just the main file?Is the code I have used sufficient to prevent caching on all browsers?