function clear_browser_cache_instructions
A utility function that prints formatted instructions to the console for clearing browser cache across different web browsers and operating systems.
/tf/active/vicechatdev/vice_ai/dev_tools.py
13 - 20
simple
Purpose
This function serves as a user-friendly helper to display browser cache clearing instructions. It's typically used in web development or testing scenarios where users need to clear their browser cache to see updated content. The function provides keyboard shortcuts for Chrome, Edge, Firefox, and Safari across Windows, Linux, and Mac platforms, as well as an alternative method using Developer Tools.
Source Code
def clear_browser_cache_instructions():
"""Print instructions for clearing browser cache"""
print("🧹 Browser Cache Clearing Instructions:")
print("Chrome/Edge: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)")
print("Firefox: Ctrl+F5 (Windows/Linux) or Cmd+Shift+R (Mac)")
print("Safari: Option+Cmd+E, then Cmd+R (Mac)")
print("Or use Developer Tools > Application/Storage > Clear Storage")
print()
Return Value
This function returns None (implicitly). It performs a side effect of printing instructions to stdout rather than returning a value.
Usage Example
# Simple usage - just call the function to display instructions
clear_browser_cache_instructions()
# Example output:
# 🧹 Browser Cache Clearing Instructions:
# Chrome/Edge: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
# Firefox: Ctrl+F5 (Windows/Linux) or Cmd+Shift+R (Mac)
# Safari: Option+Cmd+E, then Cmd+R (Mac)
# Or use Developer Tools > Application/Storage > Clear Storage
# Common use case in a deployment or testing script
print('Deployment complete!')
print('If you don\'t see changes, please clear your browser cache:')
clear_browser_cache_instructions()
Best Practices
- This function is purely informational and has no side effects beyond console output
- Best used in CLI tools, deployment scripts, or development utilities where users may need to refresh their browser
- The function uses emoji (🧹) which requires UTF-8 console support
- Consider redirecting output or capturing it if you need to log these instructions to a file
- This function is synchronous and will block until all print statements complete
- No error handling is needed as print() operations rarely fail in normal circumstances
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
function print_help 55.1% similar
-
function main_v52 54.9% similar
-
function check_debug_endpoint 49.2% similar
-
function debug_cache_info 46.0% similar
-
function get_cache_buster 44.8% similar