localhost cache vs ip cache


  1. Posts : 44
    windows 7 & 8
       #1

    localhost cache vs ip cache


    Okay this is the setup

    I am running a mysql database and localhost web site installed via XAMPP

    now all is good except for one item.
    In order to connect to the website via my lan (from another PC) I use a local ip
    (example: 192.168.1.3/test/admin.php)
    in normal use on the same computer i acces it via
    (example: localhost/test/admin.php)

    Now here is the rub, if I alter my css while using the localhost, it does not update on the ip address
    even if I do a ipconfig/ flushdns, it flushs localhost but that still does not flush the ip address content
    the content will display differently dependent on using localhost or ip address.

    So my question is how do I flush the ip address content?

    Hope that all makes sense.

    [Update - solved it]
    I needed to turn off cacheing using
    <meta http-equiv="cache-control" content="no-cache" />
      My Computer


  2. Posts : 10,485
    W7 Pro SP1 64bit
       #2

    I understand that the issue is solved...
    ...but I wanted to make a comment/question:

    You can disable the service named DNS Client. This means that you don't need to flush the DNS cache - since there will be no cache to flush. (Well, there will be no DNS cache at the OS level. Browsers still DNS cache info until they exit RAM.) If I'm understanding your post correctly, flushing DNS cache was just something that you tried and it turned out to have nothing to do with your problem. The info about disabling the caching service is just FYI at this point.

    Why use localhost/test/admin.php?
    When on the same computer, does it not work to use that computer's static IP address?
    (e.g. 192.168.1.3/test/admin.php)


    Thanks for reading.
      My Computer


  3. Posts : 44
    windows 7 & 8
    Thread Starter
       #3

    UsernameIssues said:
    I understand that the issue is solved...
    ...but I wanted to make a comment/question:

    You can disable the service named DNS Client. This means that you don't need to flush the DNS cache - since there will be no cache to flush. (Well, there will be no DNS cache at the OS level. Browsers still DNS cache info until they exit RAM.) If I'm understanding your post correctly, flushing DNS cache was just something that you tried and it turned out to have nothing to do with your problem. The info about disabling the caching service is just FYI at this point.

    Why use localhost/test/admin.php?
    When on the same computer, does it not work to use that computer's static IP address?
    (e.g. 192.168.1.3/test/admin.php)


    Thanks for reading.
    yes the static ip works on the local machine, it is easier for me to remember localhost than the ip. With 8 machines on our LAN I am forever having to check to see which ip is for which.

    And yes I could turn off DNS, but I do a lot of experimenting and programming on all of the machines, for various things. So, I like to keep the machines on in their native state. It is to much to remember which, I have on and off, on which machine, etc., so the easy solution is to just leave them as is. Thank you for the suggestions.
      My Computer


  4. Posts : 2,465
    Windows 7 Ultimate x64
       #4

    It has nothing to do with DNS settings or any ip/localhost configuration. As you discovered yourself, it's only a matter of the browser caching the old css and using it instead of requesting a new copy from the server. Look at the network traffic in the browser development tools to verify this.

    Have a look here for further details:
    html - Browser Caching of CSS files - Stack Overflow
      My Computer


  5. Posts : 10,485
    W7 Pro SP1 64bit
       #5

    Ah yes. Remembering IP addresses. Makes sense now.

    Disabling DNS would only be for brief testing. I leave the service property window open to remind me to put it back the way that it should be. I also have several virtual machines that I use for testing. They revert back to a known good state when I close them. You could run 8 virtual machines at the same time from one host computer - as long as the tasks were not too CPU intensive.
      My Computer


  6. Posts : 44
    windows 7 & 8
    Thread Starter
       #6

    UsernameIssues said:
    Ah yes. Remembering IP addresses. Makes sense now.

    Disabling DNS would only be for brief testing. I leave the service property window open to remind me to put it back the way that it should be. I also have several virtual machines that I use for testing. They revert back to a known good state when I close them. You could run 8 virtual machines at the same time from one host computer - as long as the tasks were not too CPU intensive.
    umm, VMs that is a good idea, thanks
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:10.
Find Us