PHP No Cache

They have: 218 posts

Joined: Apr 2001

How can I preventing PHP files from being cached? And is there a way to encrypt or protect the variable/values that are sent and loaded to and from the server?

Cheers.

TonyMontana

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

You can have a META tag in your head section to stop caching, I think it's:

Laughing out loud

They have: 218 posts

Joined: Apr 2001

How about the encryption part, Renegade? Or is SSL the only option for that?

Tony

They have: 24 posts

Joined: Feb 2002

First,
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP 1.1
header("Cache-Control: post-check=0, pre-check=0", false);

I would just use:
header("Pragma: no-cache"); // HTTP 1.0

or

Use http://www.php.net/manual/en/function.session-cache-limiter.php to automatically generate the correct caching-related headers.

Secound,
What do you mean by encrypt/protect values? What values?

If you mean form values:
- To: Try using JavaScript encryption then Post instead of Get.
- Fro: Need more info on circumstances.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Quote: Originally posted by TonyMontana
How about the encryption part, Renegade? Or is SSL the only option for that?

Tony

Sorry Tony, I don't know :S

They have: 218 posts

Joined: Apr 2001

Cog wrote: 'If you mean form values:
- To: Try using JavaScript encryption then Post instead of Get.'

Have you got a routine to illustrate this, Cog?

Cheers,

Tony

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.