For god knows what reason, Office Add-ins on my local word client is Caching a html file that I dynamically load in (through angular) and refuses to give me a way to remove it from the cache. My only solution is to rename the file and force it to look for a new one.
I know it's a caching issue and not a code issue because when I load the app up inside the web-client it always gets the new version and not the old version.
Please help, renaming files every time I change them is stupid and time consuming
I had the same, not with Angular but JS add office add ins, cut off my webserver and still was able to load the HTML!
For me what worked was the "Clear" button under Trust Centre -> Trusted Add-in catalogues.
Perhaps this is HTML5 - something to do with you manifest, something like this in your HTML, or the equivalent automatically occurring?
`<html.... manifest="/manifest.appcache">
There are loads of suggestion for how to prevent this I haven't tried it yet, but this looks like it contains reasonable examples to test - if imparted in an unusual manner!
http://alistapart.com/article/application-cache-is-a-douchebag
Second option which is now working a treat for me!
In internet Explorer go to Internet Options -> General tab -> Settings -> Temporary Internet files -> tick "Every time I visit the webpage". Naturally this only works for locally hosted sideloading apps.
Oddly enough IE seems to be the object loaded in Office 2016, not Edge, although I have had an Edge message appear in my side-load space, I'll try and grab a shot of it next time I see it (it was during an error it appeared!).
There are a few tricks that might work like this:
What does appending "?v=1" to CSS and Javascript URLs in link and script tags do?
Or in CSS like this:
https://css-tricks.com/can-we-prevent-css-caching/
Today (Win 10 1903 and newest Office 2016) Office AddIns are using Edge as WebViewHost. The WebViewHost seems to store the cached files here:
dir /s %LOCALAPPDATA%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\AC\#!123\INetCache\
In our case we are using Azure App Service (IIS) as backend for our Office AddIn.
And we added the following web.config setting to let the client re-validate all cached files on each access:
...
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:00:00" cacheControlCustom="must-revalidate" />
</staticContent>
...
Of course, the cacheControlMaxAge may be adjusted to your needs.
Hitting Ctrl + Shift + F5 helped for me.
An easy workaround for this would be to append some random query string at the end of the url, thus making sure your browser has a cache miss.
For example, instead of getting the file http://myaddin/myfile.html, append a big enough random query string parameter so that you instead query for http://myaddin/myfile.html?cache=s98sj398nf03984jf3498n.
Related
Hi I'm trying to make an offline version of this page:
https://u-he.com/tools/microtuning/ the script is writtin with Angular JS how do I do that?
I saved the page control-s and copied the file to the local server I'm running.
And then I browsed the local ip. the page opened but I get repeated notes ng-repeat shows up as multiple boxes instead of 1 box that edits the same note but in different octaves.
How do I solve this problem please.
You can inspect the front-end code in your browser console. In Firefox it's in the section called "Debugger", in Chrome it's called "Sources". If you use Safari, you need to enable Developer mode first.
Once you have the appropriate view, just click on u-he.com -> tools/microtuning/ -> index
Hopefully it goes without saying that you shouldn't use large swaths of another person's code without at least giving appropriate credit, or better yet getting the developer's permission, unless there is an explicit open-source license.
First, I apologize that I don't fully understand what's going on here. I am new to AngularJS and I am building an app that I am running on localhost:3000. I make changes to my files, and I refresh the localhost:3000 page.
But after a few times of doing this, my changes do not get passed to the server.
Upon inspecting the developer tools, I see that it is using an older version of the file that I have overwritten with new code. No matter how many times I refresh the page, the changes do not get passed to the server.
If I come back after a few hours, it gets all the changes like it should. But only the first time, because every time after that I have the same problem.
I've tried restarting the http-server, I've tried closing and opening the editor, closing and opening the tab, restarting my computer, but none of these fixes the problem permanently.
If you need any more information, I'll edit it into this question. Thanks!
Try clearing your browser cache
Either
ctrl + f5
or
Right click on refresh button and choose the last option (hard reload)
(only in chrome, I guess)
That's almost certainly a caching issue.
You need to look at the network traffic when the page is downloading.
How you do that will depend on the browser you use, but try pressing F12 for a start
Check the RESPONSE headers for anything "cache"
Also check for a Status code of 304 - "Not Modified"
That might reveal to you instructions from the server to the browser to cache the file for a few hours, or that the browser is being told the copy it has is up to date.
Alternatively it might be server side caching, in which case I can't help you much.
One other solution is to change the file reference to include the date modified as a query string.
e.g.
instead of
src="/scripts/myscript.js"
use
src="/scripts/myscript.js?dt={filemodifieddateformyscripts.js}"
i need to remove sitemap.aspx from the site.
In dnn 6,there is a sitemap.aspx page that simply shows an xml sitemap.i cannot edit/remove that file.so i need to remove that page and recreate it with a simple html sitemap.
NOTE:the page name should be sitemap.aspx
Sitemap.aspx isn't a physical page you can delete.
You can, however, rename it to something else. It's in your web.config file, under the 'handlers' section. Just look for sitemap.aspx, and change it to something else, like 'searchenginesitemap.aspx'. Don't forget to update your robots.txt file to point to the new sitemap name, or go to the various webmaster console pages in search engines and advise them of the new location.
The sitemap.aspx is used to create the xml sitemap for search engines. By changing this you break this functionality and limit the search-ability of your site.
That being said, in Host Settings->Advance Settings you could setup a new Friendly Url that would match .*/sitemap.aspx to another url/page on your site.
I have long stopped using DNN's native sitemap.aspx... ITS BUGGY!... and here is how i found out.
I generated my own "CLEAN" sitemap.xml using a free 3rd party tool. And uploaded it to the root of my DNN website.... re-submitted the the domainname.com/sitemap.xml to Google via web master tools and as a result we now get a 1ST PAGE and TOP 10 RANKING.
Mostly in the top 5... where as before using DNN's native sitemap.aspx we would get random errors which was pretty ANNOYING. Plus we got very bad Google Page Rank, But those were just my findings of better results. Note:I also place the location of the sitemap within the robots.txt file...
Although i will admit that it is extremely ANNOYING that you cannot just edit the DNN Sitemap url. This creates an issue if you've built the the site on a test server and then migrate over to production... your DNN Sitemap url only reads the firs portal alias from when you first developed the site.
Anyway, this was my findings... others may vary... just sharing.
I am using C1 3 and am having problems with the preview pane.
The C1 site uses master pages for templates, and works correctly when published. However, it is not displaying correctly in the preview pane. It visually appears to be ignoring CSS settings.
This site was copied from an original install, on another sever, that works correctly.
Any tips and or ideas would be greatly appreciated.
*UPDATE**
In the content view, which is not working, it is using this url
http://www.abc.com/Composite/content/Frontend/Images/logo.gif
All other sites, including the published version of the site above use this url
http://cms.abc.dev/Frontend/Images/logo.gif
I am assuming the same is happening for all images and style sheet references.
However, I cannot find where this is happening. In the master page items are referenced as follows:
href="~/Frontend/Styles/layout.css"
ImageUrl="~/Frontend/Images/logo.gif"
Thats weird... have you somehow accidently configured the /Composite/Content folder as an application? Thats almost the only explanation why asp.net would expand ~ to /Composite/content/ instead of just /.
The preview-tab is handled through a wrapper-page that lives inside /Composite/content, unlike normal viewing of published pages which is handles by the root itself.
I think i found the problem...
I created a new app pool, used it, and now it works.
I guess the app pool somehow got corrupted...
I'm assuming the issue I'm having is related to caching. Code changes I make are not getting picked up when I debug. Most times I get served a previous version of the app. How do I prevent this from happening?
Ctrl+F5 is an easy way to refresh a page and clear the cache of that page at the same time - it may help :)
Try to add to the page that hosts Silverlight application on Page_Load:
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-100));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Append a "version" querystring to your XAP Url, something like:
http://localhost:1234/ClientBin/my_silverlight_app.xap?v=1.0.287.5361
This will trick the browser (and many web servers) to think that this is a different file. And when the cache problem appears again, increase the number.
If you then want to employ proper caching, do it on the server-side with OutputCache directives.
As far as I see, this seems to be a problem with Firefox - when I used IE8, this didn't happen to me (I realize this may open its own can of worms, but at least for debugging and testing Silverlight, IE is much better)
I have not had any issues with Silverlight assemblies getting cached - you might want to try debugging the HTTP requests that go back and forth, to see if maybe your server is instead returning incorrect information to the browser (e.g. a "not modified" response).
For general no-cache behavior, the only reliable method I have found is to turn off caching in the browser.
For IE, this has been the only reliable option - otherwise, even if proper no-cache headers are sent, certain things are still cached (specifically, dynamically loaded resources which are accessed via Javascript XmlHttpRequest). I have not specifically had issues with Silverlight getting cached when it should not, though - IE has always loaded the latest updates even if cache is enabled.
Firefox has been much more problematic - even when disabling cache, it still sometimes caches XmlHttpRequest-loaded resources. Manually hitting Refresh a few times has been the only solution in such a case. Once again, I have had no issues with Silverlight assembles, even if cache is turned on.
In Firefox, I use the 'web developer' plugin and simply select to 'disable cache'. Works fine.
Firefox 3.5 under Tools has the option for Private Browsing. Click that to disable caching.
Here is how I have done it for flex/flash and silverlight and it works.
Code Behind ASPX or CSHTML
string slUrl = "/ClientBin/MySilverlight.xap";
string filePath = Server.MapPath(slUrl);
FileInfo info = new FileInfo(filePath);
// this will force browser to
// re download file if file was
// updated
slUrl += "?t=" + info.FileWriteTime.Ticks;
ASPX or CSHTML
<embed ....
src="<%= slUrl %>"
..
/>
Trick is you have to change url by adding something after ? and make a new arbitrary random query string or use file write time, and for browser, something?t=1 and something?t=2 are two urls and it will not pickup cache if t changes.
Instead of write time, you can also choose any standard config value or you can even simply hardcode your ASPX or HTML and append something after ? that will force browsers to download silverlight xap file again.
<embed ....
src="/ClientBin/MySilverlight.xap?something-different-each-time"
...
/>