WebMatrix shows old page still - html

I am using Microsoft webmatrix to do some HTML coding. But even though I changed contents of my HTML, the browser is still showing my old page.
Please see screenshots. I even tried restarting webmatrix, but still old page is shown.
Still shows old page:
Why? I clicked save all too.

The content of the page is being cached by your browser.
If you want to prevent this behaviour add the following to your <head> section:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">

Related

React - Viewport being ignored

In my index file I have the following:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
I am using React to load the page, but the main index file is an HTML file. (.pug)
This is inserted correctly into the DOM. However, the viewport is ignored - my page is showing the desktop version.
If I edit the DOM in the Chrome dev tools, eg. change 1 to 1.0 or any other part of the meta tag, it causes the page to re-calculate the viewport correctly, and will then display correctly straight away. Any ideas?
You might need to click the image to see the GIF animation.
Try using meta(name='viewport', content='width=device-width, initial-scale=1.0') in your index.pug file.
Based on your code, try using meta(name='viewport', content='width=device-width, initial-scale=1.0, maximum-scale=1.0')
Try using this. It works for me.
<meta name="viewport" content="width=device-width" initial-scale="1.00" maximum-scale="1.0" />
Well, you could try triggering the viewport recalculation manually on page load with, for example:
window.getComputedStyle(document.body)
Please, note that this is not the best solution. It should just be used while (or only if) the root cause issue is not found.

clearing redirect cache from a different location for Chrome

How do you tell the Chrome Browser to not use the cached version of your site when it is redirected from a different location?
We have site www.example.com which has the normal cache busting techniques meta tags and adding ?a=b in your file and http calls however.
<meta http-equiv="cache-control" content="max-age=0"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<script src="src/app.js?v=3.21.54"></script>
You update your code and all the customers get the new not the old, this works great!
Then SharePoint happened...
Your company got SharePoint which has a link to your site www.example.com but you found something odd happening Chrome uses cache when it is being redirected. Now with your bustfu failing what does one do?

Webpage stopped responding to external CSS changes

I'm currently working on developing a website on my computer, and I've been very successful at working on my html and external stylesheet for some time. The results don't come out the way I want, but at least the code is doing what I tell it to do.
However, I've been trying to incorportate PHP into my pages and I've since downloaded MAMP to my computer and changed my pages into .php pages so that the php pages I want to include are included. I managed to do all that just fine and yesterday I went back to work on my layout some more.
Suddenly, none of my webpages, either the .php version or the original .html version, are interacting or responding to changes I make in my .css file. It all worked fine before, but now suddenly it wont respond. I've tried turning my MAMP server off, I've tried removing the .css file and then restoring it (thinking somehow it was getting stuck on old code?) and I've tried tweaking the code in the original folder I was working out of. Not that it should matter, and it didn't.
Am I missing something?
When I downloaded MAMP, I had to copy and more my original files to the "htdocs" folder so that my local host could have access to the files. I would understand if there was something wrong there, but it isn't responding in the original files either.
In addition to changes not being acknowledged (or perhaps because of), my navigation bar is responding to code that doesn't exist.
Is there a way to fix this that does not involve starting over?
This sounds like a caching issue.
There are tags you can use that will help. Also make sure your browser cache settings aren't on Automatic, but Every visit to the page.
I have to use all these to try to cover all the bases:
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

How to tell Firefox to load my page from server each time

I'm writing a simple web page that shows the status of my server, and therefore must always be loaded from the server, and not from the cache.
How do I make it happen? I've tried
<head>
<meta http-equiv="expires" content="0">
<title>status</title>
</head>
But it only works with Chrome. Any ideas about Firefox?
Have you tried:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
This has worked for me in the past to resolve Firefox caching issues.
Source: http://www.i18nguy.com/markup/metatags.html

How do you disable caching on Modal dialogs in IE?

We have implemented a popup window as a modal dialog using the IE method:
window.showModalDialog('...aspx')
The target of the popup window is itself an ASP.Net web page.
Assume for the following steps that the popup has never been launched:
Launch popup.
Page_Load event handler executes on server side.
Close popup.
Immediately launch popup again.
This time Page_Load event handler doesn't execute.
It's clear that the popup content is being cached because if at Step 4 we clear the temporary internet files the Page_Load event handler is executed the second time.
We have experimented with adding the following to the Head of the web page (as recommended by several other sources) but none of it seems to work.
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
We have also seen places where the use of these is discouraged
Can anyone help?
Add a timestamp querystring variable to the URL of the dialog content - number of ticks since 1/1/08 or something - IE will treat it as a new page and ignore the cache.
To clear cache add this in page load:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Given that the http-equiv directives don’t work (and arguably shouldn’t be used), and despite it unfortunately being in the hack category of solutions, I think we are going to have to go with this (posted by Greg)...
url = "<Some url with query string>"
var date = new Date();
window.showModalDialog(url + “&” + date.getTime(), ... );
It is strange that there is no definitive way to disable caching on these modal dialogs. I’m not sure whether using modal dialogs in web browsers is accepted as a "good idea" or not, but we are aware of at least some of the shortcomings and alternatives, but are just unfortunately unable to use them in this project.
Thanks for your suggestions.
Place Fiddler in between the IE and your server. Then check if the response to your request carries a HTTP header Cache-Control. Is there some value given other than no-cache ? If so then maybe IE will give this header priority over your http-equiv directive.
If not, you should try to make the server send the HTTP header Cache-Control:no-cache. If IE does not respect this, it's a bug in IE. Experience shows it's less painfull to opt for a different solution than to press for a bugfix, so in this case I'd agree to the tip of Greg.
First i tried by using the following code.
meta http-equiv="Cache-Control" content="no-cache"
meta http-equiv="Pragma" content="no-cache"
meta http-equiv="Expires" content="-1"
but it was not given any solution after, i tried with Query String with time stamp variable,
like
vat time = new Date().getTime();
url?queryString&time=time
then it works....
Thanks...
you forgot a tag to reprocess the page.
<base target="_top" />
if you put below tags, the cache will be cleaned:
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<base target="_top" />
One of the strange quirks of IE is that setting no-cache at the beginning of the file doesn't seem to work, but moving that section to after the original HTML often does. Still best to send it as an HTTP header, but the following will work in most cases:
<html>
<head><title>Blah</title></head>
<body>Contents</body>
</html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
</head>
</html>
The answer Response.Cache.SetCacheability(HttpCacheability.NoCache); is the only one that works correctly with IE9. If you set the timestamp in the querystring, you still have to refresh the page to get a different URL. So, the modal dialog is still cached until the page is refresh, unless you use Response.Cache.SetCacheability(HttpCacheability.NoCache);
Using a timestamp on the URL and Response.Cache.SetCacheability(HttpCacheability.NoCache); would be best, cover all the bases. It is IE we're dealing with after all.
You could also try the following statement at the top of the aspx page being called:
<%# OutputCache Location="None" %>