Closed Thread
Results 1 to 8 of 8

Thread: Caching SQL load

  1. #1
    Jubal's Avatar
    Jubal is offline Newbie
    Join Date
    Jan 2009
    Posts
    22
    Rep Power
    0

    Caching SQL load

    I have no idea where to put this, so please feel free to shunt it to the correct place.

    My site has a frame-based interface, and mostly runs on javascript. I use AJAX to load a user's details from the database on login, and the program saves the details each 'turn'. However, even though the details are correctly saved, if I close the browser window and then return soon afterwards, then when I log in it gives the same details I got lat time I logged in rather than the most recent set.

    Does anyone know how I can prevent this?
    I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Caching SQL load

    It sounds more like your browser is caching the results, rather than the SQL. What database are you using? Can you try it in another browser after making a change and see if it changes?

  4. #3
    Jubal's Avatar
    Jubal is offline Newbie
    Join Date
    Jan 2009
    Posts
    22
    Rep Power
    0

    Re: Caching SQL load

    It does change, so I guess it is the browser. How do I prevent that then?
    I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.

  5. #4
    Jubal's Avatar
    Jubal is offline Newbie
    Join Date
    Jan 2009
    Posts
    22
    Rep Power
    0

    Re: Caching SQL load

    I've tried a couple things which supposedly stop the page caching, but they don't seem to work... argh...
    I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.

  6. #5
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Caching SQL load

    Set a PHP header to stop caching.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  7. #6
    Jubal's Avatar
    Jubal is offline Newbie
    Join Date
    Jan 2009
    Posts
    22
    Rep Power
    0

    Re: Caching SQL load

    Perfect, works now.

    Many thanks!
    I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.

  8. #7
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Caching SQL load

    What code did you use in the end?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  9. #8
    jpiche is offline Newbie
    Join Date
    Aug 2009
    Location
    Minneapolis
    Posts
    16
    Rep Power
    10

    Re: Caching SQL load

    In case someone still needs it, the php
    Code:
    header
    function (documentation) is where you specify the "Expires: date_in_past" to prevent browser caching. Although some sites actually benefit from caching; I do not disable it on my coding blog.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Make images only load when on homepage, reduce load time
    By liamzebedee in forum PHP Development
    Replies: 0
    Last Post: 05-19-2011, 03:01 PM
  2. How to load .jsp instead of .faces
    By ThemePark in forum Java Help
    Replies: 1
    Last Post: 06-13-2010, 06:59 PM
  3. load a file on an RTB
    By ravmonster in forum Visual Basic Programming
    Replies: 7
    Last Post: 08-02-2009, 05:38 PM
  4. Can I load this xml to a dataset?
    By chepla in forum C# Programming
    Replies: 2
    Last Post: 08-12-2008, 07:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts