diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b8ba16..61027472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Visit the package at [pub.dev](https://pub.dev/packages/solidpod). ## 1.0 ++ Disable caching for web [1.0.21 20260908 jesscmoore] + Migrate oidc from 0->4 [1.0.20 20260904 gjw] + Update dependency (including rdf 1.0.0, renamed from rdflib) [1.0.19] + Support both user.server and server/user URIs [1.0.18 20260902 dc] @@ -39,8 +40,8 @@ Visit the package at [pub.dev](https://pub.dev/packages/solidpod). + Check missing resources [0.12.9 20260520 tonypioneer] + Support checking webID [0.12.8 20260520 tonypioneer] + Update Try Another WebID workflow [0.12.7 20260520 tonypioneer] -+ Bug fix to ttl rdf for special chars #628 [0.12.6 20260518 tonypioneer] -+ Upgrade solidauth and fix key file saving edge cases [0.12.5 20260427 jesscmoore] ++ Bug fix to ttl RDF for special chars #628 [0.12.6 20260518 tonypioneer] ++ Upgrade solid_auth and fix key file saving edge cases [0.12.5 20260427 jesscmoore] + Support user profile. [0.12.4 20260421 tonypioneer] + Key map + paths updates. Update file_picker. [0.12.3 20260420 jesscmoore] + Add silentLogout() [0.12.2 20260325 tonypioneer] diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 04e5fbdf..38c006c4 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,5 +1,5 @@ name: solidpodeg -description: "A new Flutter project." +description: 'A new Flutter project.' # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.13.2 + sdk: '>=3.10.0 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -53,7 +53,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. diff --git a/lib/src/solid/api/rest_api.dart b/lib/src/solid/api/rest_api.dart index f70d6da2..a24b9d9c 100644 --- a/lib/src/solid/api/rest_api.dart +++ b/lib/src/solid/api/rest_api.dart @@ -342,6 +342,7 @@ Future checkResourceStatus( 'Authorization': 'DPoP $accessToken', 'Link': isFile ? fileTypeLink : dirTypeLink, 'DPoP': dPopToken, + ...noHttpCacheHeaders, }, ); @@ -372,6 +373,7 @@ Future checkWebIdExists(String webIdUrl) async { headers: { 'Content-Type': ResourceContentType.any.value, 'Link': fileTypeLink, + ...noHttpCacheHeaders, }, ); @@ -448,6 +450,7 @@ Future checkWebIdProfile(String webIdUrl) async { 'application/trig;q=0.75, ' 'text/n3;q=0.7, ' '*/*;q=0.1', + ...noHttpCacheHeaders, }, ); @@ -586,6 +589,7 @@ Future getResource(String resourceUrl) async { 'Authorization': 'DPoP $accessToken', 'Connection': 'keep-alive', 'DPoP': dPopToken, + ...noHttpCacheHeaders, }, ); @@ -614,6 +618,7 @@ Future<({List subDirs, List files})> getResourcesInContainer( 'Authorization': 'DPoP $accessToken', 'Connection': 'keep-alive', 'DPoP': dPopToken, + ...noHttpCacheHeaders, }, ); diff --git a/lib/src/solid/constants/common.dart b/lib/src/solid/constants/common.dart index 604e910d..c6920e5f 100644 --- a/lib/src/solid/constants/common.dart +++ b/lib/src/solid/constants/common.dart @@ -292,3 +292,33 @@ enum FileOpenMode { /// String value of the mode final String value; } + +/// Request headers that stop a GET being answered from a stale HTTP cache. +/// +/// Solid servers commonly mark responses cacheable for a long period — +/// Community Solid Server sends `Cache-Control: max-age=86400` (24 hours) with +/// `Vary: Accept,Authorization,Origin`. On the web, `package:http` is backed by +/// the browser's `fetch`, which honours that, so a container listing or +/// resource read is answered from the browser cache rather than the POD for a +/// full day. Reads then return whatever was true when the cache entry was +/// written: newly created resources are invisible and deleted ones linger. +/// +/// This is web-only in practice — `dart:io`'s `HttpClient`, used on every +/// native platform, implements no shared cache — which is why the symptom +/// appears only in Flutter web builds. +/// +/// `no-cache` rather than `no-store`: the response may still be stored, but it +/// must be revalidated with the origin before reuse. Where the server supplies +/// a validator, answered with `304 Not Modified` rather than a full +/// re-download. Community Solid Server advertises `ETag` support via +/// `Access-Control-Expose-Headers`, but does not send a validator on every +/// response (a container listing observed in testing carried neither `ETag` +/// nor `Last-Modified`), so some reads will be full re-fetches. That is the +/// intended trade: correctness over a saved round trip. +/// +/// `Pragma` is the HTTP/1.0 spelling, sent alongside for intermediaries that +/// predate `Cache-Control`. +const Map noHttpCacheHeaders = { + 'Cache-Control': 'no-cache', + 'Pragma': 'no-cache', +}; diff --git a/pubspec.yaml b/pubspec.yaml index 40f6658e..36a23687 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: solidpod description: Support access to private data from PODs on Solid servers. -version: 1.0.20 +version: 1.0.21 homepage: https://github.com/anusii/solidpod environment: