Jump to content

how to cache?


moose-en-a-gant

Recommended Posts

I'm not sure if this is the appropriate forum to post about this although I chose HTML because of input of a form

 

I want to cache what I have written in the event of a username session timeout, which is what I'm facing now, I'm writing a lot of stuff, when I finally push "submit" my session username is gone and the data disappears even when I hit back.

 

I've seen this cache on a few forums and even yahoo answers

 

I need this function

 

How do I achieve it or what do I look at?

Link to comment
https://forums.phpfreaks.com/topic/294364-how-to-cache/
Share on other sites

  • 4 weeks later...

trying adding these headers to the top of the page:

header("Cache-Control: private, max-age=10800, pre-check=10800");
header("Pragma: private");header("Expires: " . date(DATE_RFC822,strtotime("+2 day")));

if the form submits and post data to a second page, you may want to put it at the top of both pages. also, make sure the code is after any session_start(); if you are using sessions.

Link to comment
https://forums.phpfreaks.com/topic/294364-how-to-cache/#findComment-1508156
Share on other sites

  • 1 month later...
  • 2 months later...

Caching is an incredible sample of the universal time-space tradeoff in programming. You can spare time by utilizing space to store results.

Program: Yo! You got index.html?

Server: (Looking it up… )

Disjoin: Totally, fella! It's right here!

Program: That's rad, I'm downloading it now and demonstrating the client.

(The real HTTP convention may have minor contrasts; see Live HTTP Headers for more points of interest

Link to comment
https://forums.phpfreaks.com/topic/294364-how-to-cache/#findComment-1514879
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.