JS cache issue

Discussion in 'JavaScript' started by tom007, Dec 3, 2006.

  1. #1
    Hi ,

    I am developing a section where we are going to host 1000's of videos. Now most of the site is going to be coded in ajax. So there are going to be several js files

    My question is , is it good t cache those js files so save time and make your page load faster? Those files are going to be change once a month, so can be put something in the headers to download it again if it was modified since last access time
     
    tom007, Dec 3, 2006 IP
  2. Yeldarb

    Yeldarb Active Member

    Messages:
    209
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Yes, there is a header for that. If I remember correctly it's

    <?PHP
    header("Pragma: no-cache");
    header("Cache-Control: private, must-revalidate");
    ?>
     
    Yeldarb, Dec 6, 2006 IP
  3. tom007

    tom007 Active Member

    Messages:
    362
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    This is the header currently sent by my application

    post-check=0, must-revalidate, no-store, no-cache, pre-check=0

    So basically, it is revalidating each time....

    I have explained more about this issue in this thread

    http://forums.digitalpoint.com/showthread.php?t=190680
     
    tom007, Dec 6, 2006 IP