Angular caching index.html for one specific url - iis

This is weirdest it can get. I did a fresh deployment of my Angular application with all new hashed js files.
Expectation is to get new files from server including html, css, js.
It is working fine except for one url where it switches back to older version of index.html from cache which then pulls older js files from cache.
I have been trying to fix this, but I couldn't find any solution.
I have already added these files in html file
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
And this in web.config
<customHeaders>
<add name="Cache-Control" value="no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0" />
<add name="Pragma" value="no-cache" />
<add name="Expires" value="0" />
</customHeaders>
But no effect of these changes.

Cache issue is related to the server not from the angular. Please look into the server configuration and headers which you are receiving in any request and you can try changing accordingly in the server configuration file till issue resolved.

Related

Open Graph Image and description not showing on WhatsApp Desktop Browser

My website’s open graph image/ Feature image does not show up when I paste my link on WhatsApp desktop Browser (mobile works fine).
May I know how to check the possible root cause?
I already use below code...
<meta property="og:title" content="Og image testing | inspify.com" />
<meta property="og:type" content="Most popular business directory of SG" />
<meta property="og:url" content="https://dummy.app.app/" />
<meta
property="og:image"
itemprop="image"
content="https://dummy.app/img/ogimage_256.jpg"
/>
<meta
property="og:image:secure"
itemprop="image"
content="https://dummy.app/img/ogimage_256.jpg"
/>
<meta property="og:site_name" content="#website" />
<meta property="fb:admins" content="Author" />
<link itemprop="thumbnailUrl" href="https://dummy.app/img/ogimage_256.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta
property="og:description"
content="https://dummy.app is your online business directory of Country"
/>
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
Thank you

Blazor: Failed to load resource: the server responded with a status of 404 ()

I'm having a very difficult time trying to understand what the issue is with my blazor application. I have a client blazor which I'm updating from .net 3.1 to .net 6. I've read the instructions regarding migrating from 3.1 to 6 however my application never loads when I'm trying to debug it. It throws:
"Failed to load resource: the server responded with a status of 404 ()" error
I've read in other posts about blazor.webassembly.js not loading properly but I'm not sure what I'm doing wrong. I've checked the references for any errors. The Api reference is running properly on .NET 6 and the Shared library is using .net standard 2.0
Here is some code in case you need it.
Thanks for your time.
Index.html:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkillMatrix.Api\SkillMatrix.Api.csproj" />
<ProjectReference Include="..\SkillMatrix.Shared\SkillMatrix.Shared.csproj" />
</ItemGroup>
</Project>
Index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>SkillMatrix.Client</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
</head>
<body>
<app>Loading...</app>
<div id="blazor-error-ui">
An unhandled error has occurred.
Reload
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>
Figured out the solution. I had to change the csproj from
<Project Sdk="Microsoft.NET.Sdk.Web">
to
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
based on this answer
Also make sure that the Microsoft.AspNetCore.Components.WebAssembly references on the item group are set to at least version 6.0.0

Azure media player not playing videos

Please see the HTML Below. This is being used to play videos uploaded to Azure.
It only works on a couple of pc's, but in general it fails. For example latest Firefox and IE11.
Any tips, fixes, would be great ...
regards,
Jon.
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta name="robots" content="noindex, nofollow" />
<base href="http://www.example.com/doc/" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="description" content=" " />
<meta name="Content-Language" content="en" />
<meta http-equiv="pragma" content="Privat" />
<meta http-equiv="expires" content="-100" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>E-Experience Video</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//amp.azure.net/libs/amp/1.6.2/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<script src="//amp.azure.net/libs/amp/1.6.2/azuremediaplayer.min.js"></script>
<video id="asmmedia" class="azuremediaplayer amp-default-skin " controls autoplay width="740" height="428" poster="" data-setup='{"logo": { "enabled": false}, "techOrder": ["azureHtml5JS", "flashSS", "silverlightSS", "html5"], "nativeControlsForTouch": false}' tabindex="0">
<source src="http://asmsoutheastasia%2Estreaming%2Emediaservices%2Ewindows%2Enet%2Fc75725e6%2D18c7%2D422a%2Dbe38%2D8b03ef4d11f7%2FJC%2DAC%2D297%2DV1%2DCalibration+%2D+Gantry+Axis+%2Eism%2FManifest" type="application/vnd.ms-sstr+xml" />
<p class="amp-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>
</video>
</div>
</html>
it looks like your manifest is 404ing right now, do you have a repro URL for this issue?

IIS sends js and css files with Mime text/html but only for SOME not all

A handful of js and css files are not being loaded by the webpage (404 not found) because the mime type is coming back as text/html instead of text/css or application/x-javascript:
I have tried changing my .htaccess file to the following:
AddType text/x-component .htc
AddType text/css .css
AddType application/x-javascript .js
The resources that load versus the ones that do not are written in exactly the same way. This one is working:
<script src="assets/js/jquery-validate/jquery.validate.min.js" type="text/javascript"></script>
This one is not working:
<script src="assets/js/jquery-ui-1.11.0.custom/jquery-ui.min.js" type="text/javascript"></script>
I have also tried editing the regedit entry for js to include the content type and perceived type:
I have also tried to add the following in my web.config:
<system.webServer>
<staticContent>
<remove fileExtension=".js" />
<mimeMap fileExtension=".js" mimeType="application/x-javascript" />
<remove fileExtension=".css" />
<mimeMap fileExtension=".css" mimeType="text/css" />
</staticContent>
</system.webServer>
Same permissions are also set on all these files. At this point, I know it has to be some configuration on the server because I have this exact same version of the code deployed on a different server with no issues...any ideas?

PhoneGap iOS prevent overscroll

PhoneGap version: 2.9
Test device: 3gs with iOS 6.1.3
I'm using the PhoneGap build service provided by Adobe
I want to prevent the whole app from overscrolling. I've read the related questions and added the following to my config.xml
<preference name="DisallowOverscroll" value="true" />
<preference name="UIWebViewBounce" value="false" />
which has no effect.
What am I doing wrong?
Finally found it: it's webviewbounce not UIWebViewBounce
<preference name="webviewbounce" value="false" />
PhoneGap Build will translate this to DisallowOverscroll.
See http://community.phonegap.com/nitobi/topics/2_7_0_webview_bounce_bug for discussion.
I am using PhoneGap version 3.0.0
I had to do two things to get this working:
Firstly:
I had this set in my index.html:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />
Needed to change this to:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=medium-dpi" />
When setting device height, my 100% heights were taking into consideration the status bar.
I then also had to add this line into my config.xml:
<preference name="DisallowOverscroll" value="true" />
Hope this helps,
Ian

Resources