Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Caching Problem (I think)


Message #1 by "Peter Byers" <pb@s...> on Sat, 30 Mar 2002 07:55:28
Hi
	I am using the code below - it is picking up an old version of the 
file and when I read the file, it reads an old (non existant) version of 
it. 

	I guess that this is IIS cacheing.

	It is driving me crackers - what is wrong with the code - how can 
I stop it using cached info.

Thank you - in anticipation (I hope)
Pete (Northolt UK)


*****************************************************
********               Code below            ********
*****************************************************


session.LCID = 2057

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2 ' Opens the file using the system default.
Const TristateTrue = -1 ' Opens the file as Unicode.
Const TristateFalse = 0 ' Opens the file as ASCII.

ListFileName = "list.asp"
returnedText = ""

Set objFS=Server.CreateObject("Scripting.FileSystemObject")
 strFileName= Server.MapPath(ListFileName)

Response.Write strFileName & "<P>"


If objFS.FileExists(strFileName) = True Then

	Set objTextS = objFS.OpenTextFile(strFileName, ForReading, False, 
TristateFalse)

		charBackList = ""

		Do While objTextS.AtEndOfStream <> True
			charBackList = charBackList & objTextS.Read(1)
		Loop

		filespec = strFileName
		Dim fso, f
		Set fso = CreateObject("Scripting.FileSystemObject")
		Set f = fso.GetFile(filespec)
  

Response.Write f.DateCreated & "<P>"
Response.Write charBackList & "<P>"
Else
  Response.Write "List does NOT exist"
End If
Message #2 by "Anna Aronova" <annaa@v...> on Sat, 30 Mar 2002 13:45:42 +0200
Hi,
You can disable caching in the browser itself.
If it is IE, go to Tools -> Internet Options -> General -> Settings ->
mark an option "Every Visit to the page". And in addition on the General
(tab)-> "Delete Files..."

It will check for newer version of the file and will give you indication
if the problem is in caching.

Anna

-----Original Message-----
From: Peter Byers [mailto:pb@s...] 
Sent: Saturday, March 30, 2002 7:55 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Caching Problem (I think)


Hi
	I am using the code below - it is picking up an old version of
the 
file and when I read the file, it reads an old (non existant) version of

it. 

	I guess that this is IIS cacheing.

	It is driving me crackers - what is wrong with the code - how
can 
I stop it using cached info.

Thank you - in anticipation (I hope)
Pete (Northolt UK)


*****************************************************
********               Code below            ********
*****************************************************


session.LCID = 2057

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2 ' Opens the file using the system default.
Const TristateTrue = -1 ' Opens the file as Unicode. Const TristateFalse
= 0 ' Opens the file as ASCII.

ListFileName = "list.asp"
returnedText = ""

Set objFS=Server.CreateObject("Scripting.FileSystemObject")
 strFileName= Server.MapPath(ListFileName)

Response.Write strFileName & "<P>"


If objFS.FileExists(strFileName) = True Then

	Set objTextS = objFS.OpenTextFile(strFileName, ForReading,
False, 
TristateFalse)

		charBackList = ""

		Do While objTextS.AtEndOfStream <> True
			charBackList = charBackList & objTextS.Read(1)
		Loop

		filespec = strFileName
		Dim fso, f
		Set fso = CreateObject("Scripting.FileSystemObject")
		Set f = fso.GetFile(filespec)
  

Response.Write f.DateCreated & "<P>"
Response.Write charBackList & "<P>"
Else
  Response.Write "List does NOT exist"
End If

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


Message #3 by "Peter Byers" <pb@s...> on Sat, 30 Mar 2002 11:33:41
Hi Anna
    It is not the browser - it is the server cacheing - I can go to 
another PC and still get the same problem (or my ASP code of course!!)

    Thank you for your interest though

Pete (Northolt UK)



> Hi,
You can disable caching in the browser itself.
If it is IE, go to Tools -> Internet Options -> General -> Settings ->
mark an option "Every Visit to the page". And in addition on the General
(tab)-> "Delete Files..."

It will check for newer version of the file and will give you indication
if the problem is in caching.

Anna

-----Original Message-----
From: Peter Byers [mailto:pb@s...] 
Sent: Saturday, March 30, 2002 7:55 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Caching Problem (I think)


Hi
	I am using the code below - it is picking up an old version of
the 
file and when I read the file, it reads an old (non existant) version of

it. 

	I guess that this is IIS cacheing.

	It is driving me crackers - what is wrong with the code - how
can 
I stop it using cached info.

Thank you - in anticipation (I hope)
Pete (Northolt UK)


*****************************************************
********               Code below            ********
*****************************************************


session.LCID = 2057

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2 ' Opens the file using the system default.
Const TristateTrue = -1 ' Opens the file as Unicode. Const TristateFalse
= 0 ' Opens the file as ASCII.

ListFileName = "list.asp"
returnedText = ""

Set objFS=Server.CreateObject("Scripting.FileSystemObject")
 strFileName= Server.MapPath(ListFileName)

Response.Write strFileName & "<P>"


If objFS.FileExists(strFileName) = True Then

	Set objTextS = objFS.OpenTextFile(strFileName, ForReading,
False, 
TristateFalse)

		charBackList = ""

		Do While objTextS.AtEndOfStream <> True
			charBackList = charBackList & objTextS.Read(1)
		Loop

		filespec = strFileName
		Dim fso, f
		Set fso = CreateObject("Scripting.FileSystemObject")
		Set f = fso.GetFile(filespec)
  

Response.Write f.DateCreated & "<P>"
Response.Write charBackList & "<P>"
Else
  Response.Write "List does NOT exist"
End If

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


Message #4 by "Anna Aronova" <annaa@v...> on Sat, 30 Mar 2002 19:14:51 +0200
Hi, Pete!
There was good article about how to deal with cache on application
level:
http://www.learnasp.com/learn/cachenomore.asp

Hope it will help.

Best Regards,
Anna


-----Original Message-----
From: Peter Byers [mailto:pb@s...] 
Sent: Saturday, March 30, 2002 11:34 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Caching Problem (I think)


Hi Anna
    It is not the browser - it is the server cacheing - I can go to 
another PC and still get the same problem (or my ASP code of course!!)

    Thank you for your interest though

Pete (Northolt UK)



> Hi,
You can disable caching in the browser itself.
If it is IE, go to Tools -> Internet Options -> General -> Settings ->
mark an option "Every Visit to the page". And in addition on the General
(tab)-> "Delete Files..."

It will check for newer version of the file and will give you indication
if the problem is in caching.

Anna

-----Original Message-----
From: Peter Byers [mailto:pb@s...] 
Sent: Saturday, March 30, 2002 7:55 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Caching Problem (I think)


Hi
	I am using the code below - it is picking up an old version of
the 
file and when I read the file, it reads an old (non existant) version of

it. 

	I guess that this is IIS cacheing.

	It is driving me crackers - what is wrong with the code - how
can 
I stop it using cached info.

Thank you - in anticipation (I hope)
Pete (Northolt UK)


*****************************************************
********               Code below            ********
*****************************************************


session.LCID = 2057

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2 ' Opens the file using the system default.
Const TristateTrue = -1 ' Opens the file as Unicode. Const TristateFalse
= 0 ' Opens the file as ASCII.

ListFileName = "list.asp"
returnedText = ""

Set objFS=Server.CreateObject("Scripting.FileSystemObject")
 strFileName= Server.MapPath(ListFileName)

Response.Write strFileName & "<P>"


If objFS.FileExists(strFileName) = True Then

	Set objTextS = objFS.OpenTextFile(strFileName, ForReading,
False, 
TristateFalse)

		charBackList = ""

		Do While objTextS.AtEndOfStream <> True
			charBackList = charBackList & objTextS.Read(1)
		Loop

		filespec = strFileName
		Dim fso, f
		Set fso = CreateObject("Scripting.FileSystemObject")
		Set f = fso.GetFile(filespec)
  

Response.Write f.DateCreated & "<P>"
Response.Write charBackList & "<P>"
Else
  Response.Write "List does NOT exist"
End If

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


Message #5 by "Peter Byers" <pb@s...> on Sat, 30 Mar 2002 17:44:37
Hi
    I just realised that I should have been using "DateModified" 
not "DateCreated".

Sorry to have wasted your time.

Thank you for your interest.

Pete (Northolt UK)

> Hi
	> I am using the code below - it is picking up an old version of 
the 
f> ile and when I read the file, it reads an old (non existant) version of 
i> t. 

> 	I guess that this is IIS cacheing.

> 	It is driving me crackers - what is wrong with the code - how can 
I>  stop it using cached info.

> Thank you - in anticipation (I hope)
P> ete (Northolt UK)

> 
*> ****************************************************
*> *******               Code below            ********
*> ****************************************************

> 
s> ession.LCID = 2057

> Const ForReading = 1, ForWriting = 2, ForAppending = 8
C> onst TristateUseDefault = -2 ' Opens the file using the system default.
C> onst TristateTrue = -1 ' Opens the file as Unicode.
C> onst TristateFalse = 0 ' Opens the file as ASCII.

> ListFileName = "list.asp"
r> eturnedText = ""

> Set objFS=Server.CreateObject("Scripting.FileSystemObject")
 > strFileName= Server.MapPath(ListFileName)

> Response.Write strFileName & "<P>"

> 
I> f objFS.FileExists(strFileName) = True Then

> 	Set objTextS = objFS.OpenTextFile(strFileName, ForReading, False, 
T> ristateFalse)

> 		charBackList = ""

> 		Do While objTextS.AtEndOfStream <> True
	> 		charBackList = charBackList & objTextS.Read(1)
	> 	Loop

> 		filespec = strFileName
	> 	Dim fso, f
	> 	Set fso = CreateObject("Scripting.FileSystemObject")
	> 	Set f = fso.GetFile(filespec)
 >  

> Response.Write f.DateCreated & "<P>"
R> esponse.Write charBackList & "<P>"
E> lse
 >  Response.Write "List does NOT exist"
E> nd If

  Return to Index