43 lines
1.6 KiB
Swift
43 lines
1.6 KiB
Swift
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")
|
|
}
|
|
}
|