mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
LibWeb: Evict replaced Resource objects from cache
When a Resource is converted to an ImageResource, evict the original resource from cache. The original resource's data has been moved, so on a warm reload of a page, when that resource is loaded from cache, it would not have any data to actually show.
This commit is contained in:
parent
004f69b535
commit
20eb441cba
3 changed files with 9 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibTextCodec/Decoder.h>
|
||||
#include <LibWeb/HTML/HTMLImageElement.h>
|
||||
#include <LibWeb/Loader/Resource.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
|
@ -39,6 +40,7 @@ Resource::Resource(Type type, Resource& resource)
|
|||
, m_response_headers(move(resource.m_response_headers))
|
||||
, m_status_code(move(resource.m_status_code))
|
||||
{
|
||||
ResourceLoader::the().evict_from_cache(m_request);
|
||||
}
|
||||
|
||||
Resource::~Resource() = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue