Flutter WebアプリをFirebase Hostingで配信する際の、最適なキャッシュ制御(Cache-Control)に関するドキュメントです。
※Flutter 3.22以降前提
Flutter Webにおけるキャッシュ制御には、主に以下の3つのアプローチが考えられます。
| import subprocess | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| # 1. Gitのコミット履歴を抽出 | |
| print("Extracting commit logs...") | |
| result = subprocess.run(['git', 'log', '--date=short', '--format=%ad'], capture_output=True, text=True, check=True) | |
| commits = result.stdout.strip().split('\n') | |
| # 2. データフレームの作成と集計 |
| targets: | |
| $default: | |
| builders: | |
| freezed: | |
| options: | |
| map: false | |
| map_or_null: false | |
| maybe_map: false | |
| when: false | |
| when_or_null: false |
| import * as logger from 'firebase-functions/logger' | |
| import { defineSecret } from 'firebase-functions/params' | |
| import { HttpsError, onRequest } from 'firebase-functions/v2/https' | |
| const secretKey = defineSecret('convertMapSecretKey') | |
| const googleMapsApiKey = defineSecret('convertMapGoogleMapsApiKey') | |
| async function getFtidFromShortUrl(shortUrl: string): Promise<string> { | |
| const response = await fetch(shortUrl, { | |
| method: 'GET', |
| import 'dart:collection'; | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_hooks/flutter_hooks.dart'; | |
| import 'package:intl/intl.dart'; | |
| void main() => runApp(const App()); |
| void main() { | |
| print(Animal.dog.name); // 'dog' | |
| print(Animal2.dog.name); // '🐶' | |
| // Animal2 から 元々のnameのdog・cat文字列を得たい🤔 | |
| } | |
| enum Animal { | |
| dog, | |
| cat, |
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:google_fonts/google_fonts.dart'; | |
| void main() { | |
| runApp( | |
| const App(), | |
| ); | |
| } |
| sed -i "" 's/source="$(readlink "${source}")"/source="$(readlink -f "${source}")"/g' "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh" |