?
Solved

website html pages are not changed in realtime!?

Posted on 2014-07-25
12
Medium Priority
?
225 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 84

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
Are your AD admin tools letting you down?

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.

 
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 84

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 84

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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

718 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