Mehrad,
@Mehrad@fosstodon.org avatar

Does anyone know a way to force cache a website in ? I use a website that is relatively heavy with images. Every time I use this website, Firefox have to download all these PNG/JPG files from the server which of course takes time and bandwidth. It would be nice if I can somehow force caching all these image files so that Firefox don't request them every time from the server.

pheonix,
@pheonix@fosstodon.org avatar

@Mehrad Look at the info at this page, it might be helpful.

https://kb.mozillazine.org/Browser.cache.check_doc_frequency

Mehrad,
@Mehrad@fosstodon.org avatar

@pheonix Thanks for the suggestion. As far as I understand this does not work for me because "This preference controls how often to check for a newer version of a cached page", where I want it to cache the images but update the content of the page. Did I understand it wrong?

Mehrad,
@Mehrad@fosstodon.org avatar

@pheonix I just did a crude test and set the browser.cache.check_doc_frequency to 0, and it seems the text are updated which is a good thing. now I'm concerned if this would negatively affect my experience on other websites because this variable is set globally in Firefox and not tied to this particular website. Do you know how it can be set to custom variables on specific websites?

pheonix,
@pheonix@fosstodon.org avatar

@Mehrad You're welcome. Unfortunately, this setting works globally and cannot be customized for specific websites (as far as I'm aware).

If I understand your use-case correctly, you would like the images to have a higher TTL so firefox prefers the cached versions but have the actual content be updated normally.

Did you look in the addon's store for extensions related to this? Maybe smth like decentraleyes but for images (kinda). I apologize I couldn't be of more help :/

pheonix,
@pheonix@fosstodon.org avatar

@Mehrad maybe try another approach that hit my mind: why not create two profiles and have this setting enabled on one of them? Keep one profile for that website and the other for everything else?

Mehrad,
@Mehrad@fosstodon.org avatar

Just to be clear, the images are appended with a, presumably, random number like the following with (as far as I understand) no functionality and perhaps only to bypass the caching:

example.com/foo/bar.png?87253872

So ideally certain images in certain DIVs can be stripped from this trailing random number. 🤷‍♂️

ahangarha,
@ahangarha@mas.to avatar

@Mehrad
In such a scenario, the only possible solution would be what you said: replace the image url with the one without the query string.

For that, I need to be able to work on the website to experiment.

Mehrad,
@Mehrad@fosstodon.org avatar

@ahangarha
I can't share that website unfortunately 😬

I thought about writing a simple extension that apply s/(?<=\.(png)|(jpg)|(jpeg))\?\d+//g on the pages that their URL matches certain list. I don't know how well it will work though.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • firefox
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines