Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.