Skip to content

Conversation

sehnryr
Copy link

@sehnryr sehnryr commented Apr 17, 2025

Set WebsiteDataManagerBuilder::base_cache_directory with the same path as base_data_directory.

This change allows the cache directory to be changed instead of using the default one from WebKitGTK.

sehnryr added 4 commits April 17, 2025 09:45
If that was the case, the `os` property would be re-set with the new
value for the cache directory.

Also, I mis-swapped `data_directory` and `cache_directory` in
`WebContextImpl::new`'s call.
@sehnryr sehnryr requested a review from a team as a code owner April 17, 2025 08:14
@FabianLars
Copy link
Member

maybe we should just derive the cache dir from the data dir even if not 100% correct? That would match the behavior on Windows at least.

@sehnryr sehnryr changed the title feat: add cache_directory to WebContext::new fix: set WebKitGTK WebsiteDataManager's base_cache_directory Apr 17, 2025
@sehnryr sehnryr requested a review from FabianLars April 17, 2025 11:44
Copy link
Contributor

Package Changes Through 055b954

There are 1 changes which include wry with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
wry 0.51.2 0.51.3

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

let mut context_builder = WebContext::builder();
if let Some(data_directory) = data_directory {
let data_manager = WebsiteDataManager::builder()
.base_cache_directory(data_directory.to_string_lossy())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't remember what exactly the cache looks like on windows, do you think it makes sense to create a cache subdir like we do for the cookies below?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default webkitgtk put the cache in the same dir as the data, so I don't think it would be wrong to set it that way as well when providing a custom data path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants