Initial project setup - Phases 1-3 complete
This commit is contained in:
42
UI/More/NoCachingView.swift
Normal file
42
UI/More/NoCachingView.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
import SwiftUI
|
||||
import ProxyCore
|
||||
|
||||
struct NoCachingView: View {
|
||||
@State private var isEnabled = IPCManager.shared.isNoCachingEnabled
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section {
|
||||
ToggleHeaderView(
|
||||
title: "No Caching",
|
||||
description: "Bypass all caching layers to always see the latest server response. Strips cache headers from requests and responses.",
|
||||
isEnabled: $isEnabled
|
||||
)
|
||||
.onChange(of: isEnabled) { _, newValue in
|
||||
IPCManager.shared.isNoCachingEnabled = newValue
|
||||
IPCManager.shared.post(.configurationChanged)
|
||||
}
|
||||
}
|
||||
.listRowInsets(EdgeInsets())
|
||||
|
||||
Section("How it works") {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("Request modifications:")
|
||||
.font(.caption.weight(.semibold))
|
||||
Text("Removes If-Modified-Since, If-None-Match\nAdds Pragma: no-cache, Cache-Control: no-cache")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("Response modifications:")
|
||||
.font(.caption.weight(.semibold))
|
||||
Text("Removes Expires, Last-Modified, ETag\nAdds Expires: 0, Cache-Control: no-cache")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("No Caching")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user