A missing icon usually calls for checking its reference, file format and cache before redrawing the artwork. Browser tabs, iOS home screens and installable PWAs use different declarations; a social preview is a separate Open Graph image, not a favicon. This guide shows the minimum setup for each surface and how to verify that requests reach the intended files.
Which Icon Files You Need
A site does not necessarily need four unrelated image files. It has several distinct use cases, and the required resources depend on whether the site offers PWA installation or social sharing. Files can be exported from one source image, but each use case has its own reference.
| Purpose | Where it appears | Reference declared in | Read by |
|---|---|---|---|
| Tab and bookmark icon | Browser tabs, bookmarks and similar surfaces | <link rel="icon">; a root /favicon.ico can also support implicit requests |
Browser |
| iOS home screen icon | A web page added to the home screen from Safari | <link rel="apple-touch-icon"> |
iOS |
| PWA icon | Installation UI or launcher on browsers that support the Web App Manifest feature | The Manifest icons array |
Supporting browsers and operating systems |
| Social preview image | Link cards when shared | Social metadata such as <meta property="og:image"> |
Social platform crawlers |
Manifest sizes should state the actual pixel dimensions, such as 192x192; scalable vector icons can use any. Browser and operating-system support for icon formats, sizes and installation features varies, so a declaration alone cannot guarantee that every device will use the image.
A root /favicon.ico can serve browsers' implicit requests, but does not replace an iOS home-screen or PWA Manifest icon. Open Graph images serve social previews and are not part of the site-icon setup.
Writing the HTML and the Manifest
Add only the declarations your site needs to the page <head>, configure the PWA Manifest, and verify each resource. The examples use /icons/ under the site root; adjust URLs if the site is deployed under a subpath.
<!-- Tab icon: scalable SVG, with an ICO compatibility fallback -->
<link rel="icon" type="image/svg+xml" href="/icons/favicon.svg">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<!-- iOS home screen icon -->
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
<!-- PWA installation icon where supported -->
<link rel="manifest" href="/manifest.webmanifest">
<!-- Optional social preview image, not a favicon -->
<meta property="og:image" content="https://example.com/icons/share.png">
<meta name="twitter:card" content="summary_large_image">
What you should see: browser developer tools show declarations inside <head> and the actual request URL, status and response type in Network. A 404 usually means a path or deployment-directory mismatch. If the status is successful but the icon does not appear, inspect the file, Manifest parsing and browser support. ICO MIME labels vary by server, so do not treat one exact string as the only valid value.
This Manifest sample assumes the file is at the site root and that the PNGs really are 192×192 and 512×512 pixels. Adjust resource URLs for a subpath deployment.
{
"name": "Your Site Name",
"short_name": "YourSite",
"start_url": "/",
"display": "standalone",
"icons": [
{
"src": "/icons/icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
sizes and type should match the actual file. maskable marks an asset designed for safe-zone cropping on supporting systems; it is not mandatory for every site or installation. Check the result in Chrome DevTools under Application → Manifest, then request each src directly. Other browsers may use different panels and support different features.
What you should see: the panel parses name and icons and shows the icon resources. If parsing fails, retrieve the Manifest from Network, check the JSON, and request each listed src.
Troubleshooting Order After a Swap
Work from the server outward. Clearing browser data first usually wastes the one check that would have explained everything. The table is ordered by hit rate, and the first three rows cover most cases.
| Symptom | Most likely cause | How to verify | Fix |
|---|---|---|---|
| Every visitor still gets the old icon | A CDN or browser cache still serves an earlier response | Check the requested URL, response body or ETag; Age reports residence time in a shared cache and does not by itself mean the response is stale |
Purge the applicable CDN cache by file URL, or publish a new file URL and request it again |
| Edge is fresh, your machine is not | Browsers keep tab icons in a separate cache that a reload or a clear-data click may not touch | Open the page in a private window or a browser that never visited the site | Change the filename or add a version query string so the URL changes, not just the bytes |
| New PNG shipped, tab still shows the old ico | No <link rel="icon"> is declared, so the browser makes the implicit /favicon.ico request |
Filter the Network panel on favicon and read which URL actually loads |
Declare the link explicitly and replace or delete the root favicon.ico |
| Home screen icon unchanged after install | The Manifest was not updated, or the system retained the installed icon | Check whether icons points to the intended file in Application → Manifest, then request that URL directly |
Update src to the new URL; reinstall only if the device's behavior requires it |
| Only some pages return 404 | Path case mismatch; the origin filesystem is case-sensitive | curl -sI the exact path and read the status plus Content-Type |
Standardise on lowercase filenames and use root-relative paths |
| Android crops the installed icon | Only a purpose of any is present, and the system still applies its own mask |
Look at the icon with the mask overlay in the Manifest panel | Add a purpose of maskable image with the mark inside the safe area |
Start by confirming the URL requested by the browser and the response content. With an unchanged URL, a cache may reuse a still-valid copy; assess Cache-Control, validators and CDN rules together rather than treating Age alone as proof of staleness. For general cache troubleshooting, see CDN Cache Not Updating: Troubleshooting.
Choose Icon Files by Use Case
The diagram maps the separate declaration points for icons and social preview images. Choose the entries that match the site's features, then verify every reference target.
The same source artwork can feed several destinations, but each requires its own reference. Browsers and operating systems may also cache icons separately; Cache-Control governs HTTP caching and does not guarantee that the interface refreshes immediately.
Check Asset Licensing Before Use
A site icon is a long-lived public asset. Check the licence for the specific file rather than relying on a library's free label. Record the source, licence text and attribution requirements, then check whether the artwork remains legible at small sizes.
| Check | What to confirm |
|---|---|
| Licence scope | Commercial website use, modification, redistribution and any term or purpose limits |
| Attribution | Whether the author or licence must be credited, and where that credit may appear |
| Asset provenance | The original project, licence and version for each item in an aggregated library |
| Trademarks | Whether a brand mark or app icon has separate trademark or brand-use rules |
When sourcing through an aggregator such as Iconify, open the original project's licence for the particular icon. After licensing checks, preview the image at tab size and inspect contrast, edges and transparency.
Copyable Commands
Use these commands to inspect live responses, local file formats and the result after a cache purge. Replace the example hostname, directory and paths with your own.
First, check the real response for every icon URL.
# GET each icon resource and print its response headers for inspection
for u in /favicon.ico /icons/favicon.svg /icons/apple-touch-icon.png /manifest.webmanifest; do
echo "== $u"
curl -sS -D - -o /dev/null "https://example.com$u" \
| grep -Ei '^(HTTP/|content-type|cache-control|age|etag)'
done
What you should see: each response exposes a status, Content-Type and cache headers. A 404 usually points to a path or deployment-directory mismatch; the MIME type should match the file, though ICO labels vary between servers. Age reports time in a shared cache and must be read with Cache-Control; by itself it does not show that a response has expired.
Second, audit sizes and formats locally to catch renamed files.
from pathlib import Path
from PIL import Image # pip install Pillow
for p in sorted(Path("public/icons").iterdir()):
if not p.is_file():
continue
if p.suffix.lower() == ".svg":
print(p.name, "svg", p.stat().st_size, "bytes") # Pillow does not parse SVG; report size only
continue
if p.suffix.lower() not in {".png", ".ico"}:
continue
with Image.open(p) as im:
print(p.name, im.format, im.size, im.mode)
What you should see: format agrees with the extension, and pixel size agrees with the Manifest. Preview transparent edges in RGBA or P mode against the intended background. This script does not parse SVGs or test maskable safe zones.
Third, purge the cache using the CDN's supported method, then request the resource again. A Cache-Control: no-cache request asks for revalidation; it does not guarantee that every CDN will bypass its edge cache.
# GET the resource and print headers; no-cache does not replace a CDN purge
curl -sS -D - -o /dev/null -H 'Cache-Control: no-cache' \
https://example.com/favicon.ico \
| grep -Ei '^(HTTP/|content-type|content-length|etag|age|cache-control)'
# Cloudflare case: purge the edge by URL; request fields follow the API reference
curl -sS -X POST "https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/purge_cache" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"files":["https://example.com/favicon.ico","https://example.com/manifest.webmanifest"]}' \
| head -c 300
What you should see: the purge response reports success: true and no errors. Then request the file again and compare its body hash or ETag if the origin provides one. Age may be absent, reset or begin increasing again; it is not proof by itself that the cache was purged. Give the token only the permissions needed for the target zone, not a global key.
Common Errors and Fixes
| Symptom | Cause | Fix |
|---|---|---|
| iOS home screen icon looks wrong | apple-touch-icon is missing, its path is wrong, or the image is unsuitable |
Check the declaration and response, then verify on the target device |
| An installed icon is cropped by the system | The image was not designed with a possible mask in mind | If the platform requires maskable use, provide an asset designed for its safe zone and test on-device |
| The Manifest panel reports a parse failure or no icons | The manifest returns 404, the JSON is malformed, or type disagrees with the file |
Read the raw output, validate the JSON, then open each src |
| Icons 404 after deploying under a subpath | Resource URLs do not match the deployed directory | Compare the page and Manifest locations with the actual resource paths |
| Safari shows a blank tab icon | Only SVG is declared, or type disagrees with the real file |
Add an ico or png fallback with an explicit type |
Copy the exact URL requested by the browser and make a GET request to inspect its status and content. If the status is successful but the icon still does not display, check the image format, browser support and local cache.
Limitations
- Browser and system icon caches are outside page control.
Cache-Controlgoverns the HTTP layer only; tab icons and home screen icons have their own caches, and the site does not decide when they expire. - A root
/favicon.icoimplicit request does not automatically resolve a static asset deployed under a subpath; configure the correct<link rel="icon">URL for that deployment. maskableapplies to supporting browsers and systems. If you use it, design for the safe zone and test the crop on target devices.- Social preview images follow each platform's crawl rules and image cache. Replacing the image behind an unchanged URL can leave the old card in place for a long time; use a new image URL.
- Licences may vary by asset, especially in aggregated libraries. Before launch, record the source and verify commercial-use, attribution and modification terms for each icon.
FAQ
Why does my new favicon still not show up?
Check the requested URL first. Then inspect the server response, CDN and browser caches. Use curl with a GET request to inspect the status, Content-Type and cache headers. A 404 usually indicates a path issue; a 200 only means the request succeeded, not that the image is current. Purge according to your CDN rules or publish a versioned URL, then test in a private window.
Can every Iconify SVG marked MIT be used commercially?
Not automatically. Icons in an aggregator may come from different projects, so check the specific file's original licence, attribution, commercial-use and modification terms. Downloading or self-hosting an SVG does not change its original licence. MIT is one possible licence, not a rule for every icon in the collection. Keep the licence text, source URL, review date and version if stated, and confirm required attribution can be displayed.
Should I update the manifest when swapping icons?
Yes—update each active reference separately. The tab reads <link rel="icon">, while an installed PWA reads the Manifest icons array; changing the first does not update the second. Publish a new file URL, verify the page reference and Manifest parsing, then account for browser and operating-system caching on the target device.
When should I avoid a maskable icon?
Not every site needs a separate maskable icon. Add a purpose: "maskable" asset when the target platform and design call for it, and keep important artwork within the safe zone. Verify it in the target browser and preview the masked artwork on a device before release; requirements and rendering behavior vary.
Related Providers
- Cloudflare: if the site uses its CDN and needs a cache purge by asset URL, check the applicable cache rules and API permissions.
- Iconify: use it to discover vector assets across icon sets; verify each icon's original licence before use and decide whether to self-host it.
References
- MDN: Cache-Control: what
max-ageandno-cacheactually mean, and why a new file at the same URL still shows the old icon. - W3C: SVG: the specification entry for vector source art used as a
.svgicon. - Cloudflare: Cache: edge caching and purging by URL, matching the verification commands in step three.
Community & Resources
- Frontend Building: related guides on asset handling, build configuration and delivery formats.
- CDN Image Optimization in Practice: formats, dimensions and responsive loading for images beyond the icon set.
Original source: 16IDC Original ↗