Prevent caching of index.html but allow caching of scripts - html

I have an angular2 app where I only want to force reload of the index.html page when the webpage is visited but I don't want to reload all the script files if they have already been downloaded.
Is this possible using a meta tag? e.g.
<meta http-equiv="expires" content="0">

If you use pragma meta, your index.html will not be cached but dependency may be cached anyway :
<meta http-equiv="pragma" content="no-cache">

Related

Why meta tags for no caching don't work in a Web site and the HTML pages load from cache?

I have this Web site: https://fascinatingdreams.com/fd1/index.html. I have set cache behavior to no caching in the meta tags, in the head section of the HTML files of the site, but the site fails to respect those caching directives, and the HTML files load from the cache. Developer tools show that the headers have cache-control: max-age=0.
What I want to achieve is that the HTML pages will not load from the cache.
This is the HTML code that I use to prevent caching of the Web pages:
<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">
Thank you for your answers in advance.

Forcing the browser to ignore cached iframe contents in WordPress without using a plugin

I have the situation where I need to update a static HTML file on a server running WordPress daily. This is referenced by an iframe on a single page.
I would like to prevent the iframe source from being cached, but I can't install a plugin or update WordPress themes.
I had the idea of using a script to set the source to use a query with a random parameter, but I don't believe WordPress allows JavaScript.
I also tried adding the following to the header on the iframe to no avail:
<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" />
Solution was to save the file as a .PHP instead of .HTML

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?

doxygen page expire time

When I regenerate the documentation with doxygen (1.8.7) and upload it to the webserver, I always get re-served the same pages as before the upload.
I've tried Ctrl-F5 (FireFox), I've also tried putting the following meta in src/header.html and recompiling doxygen:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="-1">
I've also tried using the .htaccess file to control the cache. Unfortunately, I always get served stale html pages.
What am I missing to totally deactivate the cache for doxygen generated html?

Prevent caching and stale content with a static web site

I am considering generating .html files for my entire web site as I want my site to be as fast as possible. The files would be generated with dynamic content via a backend service as data updates occur.
How do I ensure users always see the latest content? Say I publish a change to my home page, index.html. How do I prevent these files from always coming from the user's cache and ensure new content, if available, is always retrieved and displayed?
Remember, I am using pure HTML.
If there is absolutely no way, I would not be adverse to using .php files containing HTTP cache-related header() calls prior to the content; e.g.:
<?php header(...) ?>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
etc.
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">