Solved

website html pages are not changed in realtime!?

Posted on 2014-07-25
12
223 Views
Last Modified: 2014-07-27
Dear,
I have windows server 2008 which hosts my website.
in my website, I have 2 html pages: index.html and 1.html where in index.html there is a hyperlink to 1.html and vice versa.
If I go to index.html, and it shows in my chrome browser, then i edit it using filezilla ftp software, and repast the link in the browser new tab, i found that the old page is showing and not the new edited page. and the new page will not appear else if I press "F5" in the browser tab, and if i edit the 1.html too, i see that the 1.hml also keeps showing old data, till pressing F5.
How can I force the server to always show my last edited html files, and not by only when pressing F5!?
Thanks for your help
Note: same thing with aspx and php file, not reflecting edited files else after pressing F5
0
Comment
Question by:hassanayoub85
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
12 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40221015
You have discovered browser caching where your browser uses the last version of a page that it has loaded unless you force it to get a new version from the server.  The only way to stop that is to set the cache 'expiration' time to 0 on the server.  

While it is tempting to do that as a developer, caching actually speeds up browsing for the 'normal' user by not having to download files that have not changed.  Google's PageSpeed recommendations are that you make the cache expiration much Longer rather than shorter.  Cached files are displayed more quickly than files that have to be retrieved from the server.

I would recommend that you get used to pressing F5 while you're still developing the page.  Shortening the expiration to 0 only benefits you.  Overall, it slows your site down for your users.  

One other thing to note is that CSS and javascript files are also cached and if your 'new' page uses the same file names as the previous versions of CSS and javascript files, they may not load as you expect either.  A few times I have had to load CSS and/or javascript files in the address bar to pick up the new version and then go back to the page and press F5 to get everything to load properly.
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40221018
if your computer allow to run php , You can  save your html page to php file which  won't be cached, for example,
copy 1.html to 1.php and add <?php  ?> on the top in the file  similar to following file.

For convert to asp file, it might work  but need to check

Duncan

1.php
========
<?php

?>
<hmtl>
...........
</html>

Open in new window

0
 

Author Comment

by:hassanayoub85
ID: 40221599
Dave Baldwin:
How can make server dont allow caching at all?

duncanb7:
I tried both, php and asp.net, but same result as htlml
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:duncanb7
ID: 40221602
it won't , server language page  won't be cached,

Please click "request attention" button, other experts will assist on this subject.

Duncan
0
 

Author Comment

by:hassanayoub85
ID: 40221607
Wow, Ive jsut test it and seems everything is right, i will do more testing and get back to you
0
 

Author Comment

by:hassanayoub85
ID: 40221620
ok tested many times and eveything is right o the pc (chrome browser).
However weird things appearing on my mobile!!!
i changed the 1.php and 2.php files on server, on pc gets refreshed always and get the new and latest version, but on my mobile it wont get the last file till i either:
1- go to the application and clear on clear cache, then reopen the application.
2- or, click on the address bar and click go, like pressing F5, so it seems that mobiles are caching the contents?
Any ideawhile mobile is caching he php filesand how to avoid this?
I am using acroid kitakt and chrome browser
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40221622
How can make server dont allow caching at all?
You can't... because it isn't.  Your browsers are doing the caching.
0
 

Author Comment

by:hassanayoub85
ID: 40221624
but "duncanb7" said the browsers dont cache php files!?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40221631
"duncanb7" is only half right.  Browsers will cache the HTML that PHP files generate which is the part that you see.
0
 

Author Comment

by:hassanayoub85
ID: 40221636
So, my problem is not solvable?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40221644
Not without creating other problems.  The exact method depends on the web server you are using.  You would have to go into your web server setup and change the expiration time (that is sent with every file access) to 0.  That means not just the HTML/PHP files but also all image files, CSS files, and javascript files.

However... doing that will mean that the users of your site will see it load Every Time like you did a complete Ctl-F5 refresh every time.  If you leave it alone, then many files will be cached so they load from the local browser cache quickly instead of downloading from the server each time.
0
 

Author Comment

by:hassanayoub85
ID: 40222657
Wow thanks solved by he timestamp issue
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question