Summary
WebDAV is a natural fit for solidos-lite persistence. It treats HTML files as first-class resources - no translation needed between data islands and Turtle.
Why WebDAV?
- GET - serve HTML with data island ✓
- PUT - save entire HTML file back ✓
- DELETE, MKCOL, COPY, MOVE - all just work ✓
- Widely deployed (Apache, Nginx, Nextcloud, NAS devices)
- Battle-tested protocol (RFC 4918)
- Native OS support (mount as drive on macOS/Windows)
- Much simpler than Solid's LDP semantics
Technical Findings
Browser Support
- Browsers can make PUT requests via Fetch/XHR
- Works for overwriting existing files
- Creating new files triggers CORS preflight
CORS Challenge
- Most WebDAV servers don't return CORS headers by default
- Workarounds:
- Configure server-side CORS headers (Apache/Nginx)
- Same-origin deployment
- Use a proxy
Authentication
| Method |
Notes |
| Basic Auth |
Simple, needs HTTPS |
| Digest Auth |
Challenge-response |
| Bearer Token |
Modern, needs server support |
JavaScript Libraries
webdav npm package (recommended, actively maintained)
- Raw Fetch/XHR for simple cases
Implementation Approach
Phase 1: Basic PUT support
// Intercept writes, serialize HTML with updated data island
async function saveToWebDAV(url, htmlContent) {
const response = await fetch(url, {
method: 'PUT',
headers: { 'Content-Type': 'text/html; charset=utf-8' },
body: htmlContent
});
return response.ok;
}
Phase 2: Serialize data island
- Intercept
fetcher.webOperation() for PUT/PATCH
- Serialize RDF store back to Turtle
- Update
<script type="text/turtle"> in DOM
- PUT entire HTML document
Phase 3: Authentication UI
- Prompt for WebDAV credentials
- Store in sessionStorage
- Add Authorization header to requests
Example Servers for Testing
- Apache mod_dav
- Nginx with dav_ext_module
- Nextcloud (needs CORS config)
- sabre/dav (PHP)
- Simple Python:
wsgidav
Benefits Over Solid Servers
- No need for servers to understand data islands
- HTML file IS the resource (no translation)
- Simpler protocol, more deployment options
- Can use existing infrastructure
Related
Summary
WebDAV is a natural fit for solidos-lite persistence. It treats HTML files as first-class resources - no translation needed between data islands and Turtle.
Why WebDAV?
Technical Findings
Browser Support
CORS Challenge
Authentication
JavaScript Libraries
webdavnpm package (recommended, actively maintained)Implementation Approach
Phase 1: Basic PUT support
Phase 2: Serialize data island
fetcher.webOperation()for PUT/PATCH<script type="text/turtle">in DOMPhase 3: Authentication UI
Example Servers for Testing
wsgidavBenefits Over Solid Servers
Related