1

I am running WAMP as a local server for the computers in the my network.

The problem is that when I try to do any operations to the database from these computers, it seems as if they don't happen, even though they do.

I have a mysql table called person with the fields id,lastname,name when I try to add a new person or edit one of them everything seems fine, but when i check to see if the person has been added/edited it seems as if it hasn't, even tough when i check into my database, the changes have been done.

Digging a little further, I realized that when I access to my system via http://localhost/system/ all the changes to the database are reflected immediately, but when I access to the system via IP address http://12.12.123.12/system/, the updates doesn't show up until i close the webpage or hit refresh about 5 times.

httpd.conf

ServerRoot "c:/wamp/bin/apache/apache2.2.21"
Listen 80
ServerName localhost:80
DocumentRoot "c:/wamp/www/"
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
    Allow from all

</Directory>

So long story short everything is working on the database side, and when i view my page via localhost everything works fine, the problem is when i access to it from the IP address

FINAL UPDATE
My application had an <iframe> that contained all the necessary forms to display the information, turns out it was the frame the one that wasn't being refreshed so it showed the outdated info. I had to add 2 lines of code so that it wouldn't cache the information and always show the current information. Here is what i added:

header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
8
  • -1 This really doesn't make any sense. Please consider re-reading this from the perspective of someone that's not you and edit this so that we can make sense of this. I'll check back in a bit and remove my downvote if you've fixed this question.
    – MDMarra
    Aug 1, 2012 at 19:27
  • I'm sorry someone edited my code and deleted some sentences, i'm updating it again Aug 1, 2012 at 19:30
  • My comment was from before the edit. Please don't just roll the edit back, put some effort into fixing the question.
    – MDMarra
    Aug 1, 2012 at 19:30
  • I have just edited it, does it makes more sense now ? Aug 1, 2012 at 19:36
  • 1
    It makes a little more sense now, but without knowing what the web application is actually doing and without seeing your my.conf and httpd.conf, no one is going to be able to answer your question.
    – MDMarra
    Aug 1, 2012 at 19:37

1 Answer 1

2

If your DB reflects the changes immediately, and accessing the site via localhost reflects them immediately, but changes are slow to appear when accessing externally, my first reaction is that you need to check for caching.

This can get you started with regards to Apache Caching: http://httpd.apache.org/docs/2.2/caching.html

If you are serving through Varnish, that is a cache and reverse-proxy tool as well. Also, your browser may be caching on you, not to mention if you are going through a standard web proxy

8
  • 1
    +1. This. My immediate thought after the last edit is client-side caching, or a cache layer installed on the server that the OP hasn't mentioned.
    – MDMarra
    Aug 1, 2012 at 19:53
  • where is it most likely the caching problem to be on the browser, my code or the server configuration ? Aug 1, 2012 at 19:53
  • @MDMarra how can i check for that cache layer ? Aug 1, 2012 at 19:54
  • You can test whether it's your browser by clearing cache and/or using a different browser.
    – gWaldo
    Aug 1, 2012 at 19:57
  • Also you can test by using curl to see the headers returned.
    – gWaldo
    Aug 1, 2012 at 19:58

Not the answer you're looking for? Browse other questions tagged .