[mythtv-users] Myth web frontend cache

Paul Harrison mythtv at mythqml.net
Tue Dec 19 12:15:43 UTC 2023

On 19/12/2023 06:26, Bill Meek wrote:

> On Monday 18 December 2023 12:49:22 AM (-06:00), James Linder wrote:
>>>> On Dec 17, 2023, at 22:17, Peter Bennett <pb.mythtv at gmail.com> wrote:
>>>> On 12/17/23 06:17, James Linder wrote:
>>>>>> On Dec 17, 2023, at 15:08, James Linder <jam at tigger.ws> wrote:
>>>>>> Is there a cache, and how to clear it?
>>>>>> I was setting icons
>>>>>> https://tigger.ws/downloads/tvguide.jpg
>>>>>> No the icon is not incorrectly named. Elsewhere both are correct (10bold.png and 10HD.png)
>>>>>> James
>>>>> Hours later the cache has cleared and correct icons for the channel loaded.
>>>>> But it would be nice to doit live. Any answers re cache. It is not ram - persist after reboot
>>>>> James
>>>> I don't understand what you are doing. The icons are stored in .mythtv/channels on the backend. They are  retrieved by using a url like this "http://backend:6544/Guide/GetChannelIcon?ChanId=10002". The browser may cache them. The response headers show the file date and time so the browser should not use a cached version if the file date is newer than the cached version. If you are seeing old cached icons you could try using touch to update the file date, e.g. "touch *.png" in the channel directory, or clear the browser cache.
>>> Peter again my naviet leading me
>>> I expected that like you can do with php, your web page would tell the browser ‘do not cache’ so I thought that the only caching was on the server side.
>>> I had been doing minor tweeks with gimp. One station (SBS) has a logo
>>> +——————--—+
>>> | elongated picture |
>>> +—--——————+
>>> the webfrontend shows
>>> +————+
>>> | elongate |
>>> +---———+
>>> making the logo square by making the canvas square makes the logo pretty
>>> (ref the picture https://tigger.ws/downloads/tvguide.jpg)
>>> I’m sure that ABC logo is not square just not too elongated.
>>> [sorry if my ascii art is distorted, probably most people’s mailers use proportional fonts and the picture depends on the font]
>>> The ‘wrong’ logos were two logos that I had not touched so the dates were old.
>> https://tigger.ws/downloads/screen.jpg
>> Is there anything special about the pngs.
>> Browser cache is cleared.
>> Files are touched.
>> Yet they won’t show. Manipultion is done with gimp.
>> James
> mythweb icons are retrieved the way Peter said and get stored wherever your
> mythweb installation is under: 'data/tv_icons/'. I deleted all of mine then refreshed
> http://mybackend/mythweb/tv/recorded and they were recreated.
> $ ls -al /var/www/mythweb/data/tv_icons/
> total 284
> drwxrwxr-x 2 mythtv   www-data 49152 Dec 19 00:18 .
> drwxrwxr-x 3 mythtv   www-data  4096 Jul 18  2020 ..
> -rw-r--r-- 1 www-data www-data 34409 Dec 19 00:18 s28708_dark_360w_270h.png
> -rw-r--r-- 1 www-data www-data 11567 Dec 19 00:18 s28711_dark_360w_270h.png
> -rw-r--r-- 1 www-data www-data 51791 Dec 19 00:18 s28717_dark_360w_270h.png
> ...

@Bill When I first read it I thought MythWeb to but the images are 
definitely from the new WebApp \0/

MythWeb = the old php based web frontend served by an external web 
server like Apache

WebApp = the new TypeScript/Angular based web frontend served by mythbackend

WebFrontend = the old now defunct html/QtScript/javascript? based web 
frontend served by mythbackend

@James there is nothing special about the images. What exactly are you 
doing are you just replacing one image for another with the same name or 
are you changing the image names? It might be if you change the image 
names you need to restart mythbackend to pickup the new names?

Regarding the web browser cache side of things any web developer explain 
what exactly this header means :-

Cache-Control:  no-cache="Ext",max-age=604800

does that mean the images should be cached for up to 604800 seconds (1 
week) or should not be cached? The no-cache and max-age seem contradictory?

Paul H.

More information about the mythtv-users mailing list