Text Files and the Cache

Status
Not open for further replies.

007bond

New Member
Prime Account
Messages
35
Reaction score
0
Points
0
In one particular folder in my web directory I have over 300 text files which are loaded by a flash program but never actually brought up on the screen. Unfortunately, because these text files are downloaded they are still stored in the cache. This means that if I make alterations to this text file, the only way that the user can get the latest version of the file is for me to point them in the direction of it (no, they never actually see the file or where it is located) so they can manually refresh the page themselves.
Is there any way to make sure that these text files aren't cached?
 

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
204
Points
63
Not sure about the flash part but if you use headers you should be able to use no-cache which should tell the browser not to cache the page.

Here is an example:
<head>
<meta http-equiv="Pragma" content="no-cache">
</head>
 

007bond

New Member
Prime Account
Messages
35
Reaction score
0
Points
0
Yes but I can't do that with a plain text file, not an HTML file.
Isn't there anyway to do that server side?
 

Russ

<b>Retired *****</b>
Messages
3,168
Reaction score
2
Points
38
Add this to your .htaccess file:

AddType text/html .txt

should work..
 

007bond

New Member
Prime Account
Messages
35
Reaction score
0
Points
0
I did that and I still have the same problem.

And is the .htaccess file meant to be empty by default?
 

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
204
Points
63
Yes, it can be empty by default.

I'm not sure if you can do what you're trying to do server side.

-Corey
 
Status
Not open for further replies.
Top