Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Prevent Browser Cache

Posted on August 21, 2013October 26, 2015 By David Kittell
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
<cfheader name="expires" value="#now()#">
<cfheader name="pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">
<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
Header('Cache-Control: no-cache');
Header('Pragma: no-cache');

Sources:

  • ASP – http://support.microsoft.com/kb/311006/en-us
  • PHP – http://www.php.net/manual/en/function.header.php
  • ColdFusion – http://www.bpurcell.org/blog/index.cfm?entry=1075&mode=entry
  • JSP – http://www.jguru.com/faq/view.jsp?EID=377&page=2
Originally Posted on August 21, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

ASP Code ColdFusion JavaServer Pages JSP PHP VB

Post navigation

Previous post
Next post

Related Posts

NetSuite – SuiteScript 2.0 – Useful Functions

Posted on August 31, 2018

These first function snippets are from https://gist.github.com/W3BGUY /** * @NApiVersion 2.x * @NScriptType ScheduledScript * @NModuleScope SameAccount * * According to the documentation this is a read-only field. According to this working code and a verification from * NetSuite tech support, the documentation is wrong. Hope this helps someone out….

Read More

Bash – Trim/Remove White Space

Posted on May 4, 2017August 25, 2019

sed ‘s/^[ \t]*//’ sed ‘s/[ \t]*$//’ sed ‘s/^[ \t]*//;s/[ \t]*$//’ Originally Posted on May 4, 2017Last Updated on August 25, 2019 All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you…

Read More

Ektron Metrics – User Count By User Group

Posted on May 6, 2013October 26, 2015

Part of the Ektron Metrics Script, this query will help with metrics to give you an idea of how often your users login. SET NOCOUNT ON DECLARE @month INT ,@year INT ,@start_date DATETIME ,@end_date DATETIME SET @month = ( SELECT CASE WHEN MONTH(GETDATE()) = ‘1’ THEN ’12’ ELSE MONTH(GETDATE()) -…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes