chromium caching

464 views
Skip to first unread message

x422man

unread,
Nov 7, 2016, 2:03:47 AM11/7/16
to Chromium-discuss
is there any way other than dev-tools to disable caching in chromium. i need to permantly disable te cahing for a specific project. this is not for general browsing, it is for an automated infomation system. the source of the pages gets udated regualry, but chromium always refreshes from cache. there is no human interaction. i have tried populating http header from the server side, but these are ignored. i have tried many options suggested on search results but none have been succesful. its seem that chromium will cache everything like it or not. any help would be apprieciated

PhistucK

unread,
Nov 7, 2016, 2:06:26 AM11/7/16
to x42...@gmail.com, Chromium-discuss
stackoverflow.com would probably more helpful and more quickly.

Please, share all of the response headers for a request that gets cached.


PhistucK

On Mon, Nov 7, 2016 at 2:50 AM, x422man <x42...@gmail.com> wrote:
is there any way other than dev-tools to disable caching in chromium. i need to permantly disable te cahing for a specific project. this is not for general browsing, it is for an automated infomation system. the source of the pages gets udated regualry, but chromium always refreshes from cache. there is no human interaction. i have tried populating http header from the server side, but these are ignored. i have tried many options suggested on search results but none have been succesful. its seem that chromium will cache everything like it or not. any help would be apprieciated

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+unsubscribe@chromium.org.

Primiano Tucci

unread,
Nov 7, 2016, 9:47:18 AM11/7/16
to x42...@gmail.com, Chromium-discuss
 i have tried populating http header from the server side, but these are ignored
This is a bug if it happens. Although, I honestly suspect that something is going wrong when you set your HTTP response headers. Or maybe something in the middle mangles them. Did you check with devtools that chrome sees the expected HTTP headers? Chrome should just respect caching headers if you set the right ones.

Also, please note that the way this message is worded is really generic and doesn't allow us to give any help.
Please file a bug on crbug.com providing a repro case and attaching devtools log and dumps.
Saying "I tried many options but they don't work" is unhelpful and a waste of time for both you and us.


On Mon, Nov 7, 2016 at 8:03 AM x422man <x42...@gmail.com> wrote:
is there any way other than dev-tools to disable caching in chromium. i need to permantly disable te cahing for a specific project. this is not for general browsing, it is for an automated infomation system. the source of the pages gets udated regualry, but chromium always refreshes from cache. there is no human interaction. i have tried populating http header from the server side, but these are ignored. i have tried many options suggested on search results but none have been succesful. its seem that chromium will cache everything like it or not. any help would be apprieciated

--

x422man

unread,
Nov 7, 2016, 1:47:44 PM11/7/16
to Chromium-discuss, x42...@gmail.com
Sorry i should have been more specific.

i have not done much work with html5 and have set out on a display system project that needs pages to be refreshed continously for updates., but as the display system is using flash based storage, i did not want any caching at all to prevent execessive wear on the flash. i dont have a good knowledge of control cache, so most of my research was done via google, looking for methods to acheive the result i wanted.

the options that i tried to stop caching were first, adding html meta tags
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

this didnt work. pages still cached

I then came across references to application-cache and manifests. not sure this was what i needed, but tried it anyway. i created a manifest.appcache
CACHE MANIFEST
# 2012-02-21 v1.0.0
CACHE
:
NETWORK
:
*
and referenced it with <html manifest="manifest.appcache">
this also didnt work,


on other infomation, i tried running chromium in incognito mode. this definatly stopped the storage of cache on the flash medium,
but it kept a memory based cache while running, so pages didnt update on refresh

following more searching, i came across reference to putting the cache-control in the http headers. i did this using PHP header()


header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header
('Cache-Control: no-store, no-cache, must-revalidate');
header
('Cache-Control: post-check=0, pre-check=0', FALSE);
header("Cache-Control: max-age=1"); 
header('Pragma: no-cache');

this didnt work either. pages were still caching. and no updates were showing.

to allow me to continue coding and havethe updating, i added a unique-id to the get statement calling each page to make the browser load from the server every time.
this was a crude fix to allow me to continue my testing, but not a long term solution as the cache on disk was now being written to more than ever. a combination of this
and incognito could work for me, but its more of a bodge, so would rather not use it in production system.

this is when i posted my very brief cry for help... i should have spent more time detailing what i had done and i do apoloigise for that.

anyhow. triggered by your reply
Primiano Tucci. i set about using dev-tools to check the headers that i was receiving. it seems that only the last http cache-control header was being recieved.
so i have cleared out all cache control setting from my source pages, including meta-tags and menifests and just put in 1 cache-control http header with te value no-store.
header("Cache-Control: no-store");
this now works for updating every page on refresh. im still concerned that these pages are being written to cache on disk, as they appear in history. is there a way to view stored/cached files in dev-tools





PhistucK

unread,
Nov 7, 2016, 3:35:02 PM11/7/16
to gaz aldridge, Chromium-discuss
Not in the Developer Tools, but using an internal page -
chrome://cache


PhistucK

Primiano Tucci

unread,
Nov 7, 2016, 3:38:35 PM11/7/16
to x42...@gmail.com, Chromium-discuss
instead of trying hacking random headers until it works ;-).
to allow me to continue coding and havethe updating, i added a unique-id to the get statement calling each page to make the browser load from the server every time.
this was a crude fix to allow me to continue my testing, but not a long term solution as the cache on disk was now being written to more than ever. a combination of this
and incognito could work for me, but its more of a bodge, so would rather not use it in production system.

this is when i posted my very brief cry for help... i should have spent more time detailing what i had done and i do apoloigise for that.

anyhow. triggered by your reply
Primiano Tucci. i set about using dev-tools to check the headers that i was receiving. it seems that only the last http cache-control header was being recieved.
so i have cleared out all cache control setting from my source pages, including meta-tags and menifests and just put in 1 cache-control http header with te value no-store.
header("Cache-Control: no-store");
this now works for updating every page on refresh.
im still concerned that these pages are being written to cache on disk, as they appear in history.
Note that "writing to disk" is somehow (yet not fully) orthogonal to "reused for subsequent requests". You should worry about the disk writing part only for the case of sensitive information (e.g., banking, privacy data). In most cases you need to just worry about reusability. Not sure what is your case though
  
 is there a way to view stored/cached files in dev-tools
chrome://cache is your friend here.

justina colmena

unread,
May 8, 2018, 1:58:29 AM5/8/18
to Chromium-discuss, x42...@gmail.com
On Sunday, November 6, 2016 at 10:03:47 PM UTC-9, x422man wrote:
is there any way other than dev-tools to disable caching in chromium. i need to permantly disable te cahing for a specific project. this is not for general browsing, it is for an automated infomation system. the source of the pages gets udated regualry, but chromium always refreshes from cache. there is no human interaction. i have tried populating http header from the server side, but these are ignored. i have tried many options suggested on search results but none have been succesful. its seem that chromium will cache everything like it or not. any help would be apprieciated

I apologize for responding to an old thread, but this is an ongoing, MAJOR, MAJOR upper-management-type problem. Google Chrome's cache is simply too aggressive, and it totally ignores cache-control headers from websites.

#1.) I frequent coffee shops and fast food places, where I have to visit a login page to sign in to use the internet. Trying to visit a secure "https" page generates a certificate error, which I am not willing to waive. Instead, I have to hunt for a plain "http" webpage that is not stored in the cache in order to receive the redirect to the login page.

#2.) Right now on my hard drive, there is a folder "/home/justina/.cache/chromium/Default/Cache" which contains two hundred forty-one thousand one hundred and twenty individual little files, totaling two hundred megabytes of cache data. The files are named xxxxxxxxxxxxxxxx_0, where the x's are ASCII representations of hexadecimal digits. It takes more time for the operating system to organize, look up, and retrieve the files in this directory than it does for any web browser to retrieve the original uncached website over the internet, even on a slow connection. This is not only terribly inefficient, but a horrible abuse of a general-purpose O/S filesystem, to boot.

#3.) There do not appear to be any options in the settings to reasonably limit the total size of the cache.

What a shame for a browser that is otherwise lightning-fast!

PhistucK

unread,
May 8, 2018, 2:05:25 AM5/8/18
to justina...@gmail.com, Chromium-discuss, gaz aldridge
If Chrome is too aggressive (by ignoring standard caching headers), that may simply be a bug. If you can create a small test case (a public URL would help) that reproduces the issue, that would help fixing this.
You can search crbug.com for an existing issue and star it. If you cannot find one, file a new issue using the "New issue" link on the same page.
Please, do not add a "+1" or "Me too" or "Confirmed" (or similar) comment. It just wastes the time of Chrome engineers and sends unnecessary e-mails to all of the people who starred the issue.

You can reply with a link to the found or created issue and might get triaged (and fixed) faster.

Thank you.


PhistucK


--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.
Reply all
Reply to author
Forward
0 new messages