Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

How is roll20 caching images ?

1763349565
Jiboux
Pro
Sheet Author
Compendium Curator
hello, For the character sheet and companion API I have been working on ( Earthdawn ), I had put in the CSS a custom border both for the sheet and for the roll results of the API. In the css I have the following style for 2 different classes, one that applies to the sheet and another for the roll result &nbsp; border-image-source:&nbsp; url("<a href="https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%20%28FASA%20Official%29/Images/ED-ExternalFrame.png?raw=true" rel="nofollow">https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%20%28FASA%20Official%29/Images/ED-ExternalFrame.png?raw=true</a>"); This has already worked, but recently I noted that the border for the roll results from the API had disappeared. When examining the roll result in the chat I see that the style of the sheet is the one of the CSS, but the one for the API roll result must have been post-processed: &nbsp; &nbsp; border-image-source: url('<a href="https://imgsrv.roll20.net/?src=https%3A//raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%2520%2528FASA%2520Official%2529/Images/ED-ExternalFrame.png%3Fraw%3Dtrue" rel="nofollow">https://imgsrv.roll20.net/?src=https%3A//raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%2520%2528FASA%2520Official%2529/Images/ED-ExternalFrame.png%3Fraw%3Dtrue</a>'); I do imagine that the roll20 server is caching, the images, but is there anyway to force it to cache again so that this works again ?
1763393458
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It's not caching so much as just a proxy that serves the images. I believe that character sheets should be using the server as well. They might not use the server in a sheet sandbox though. I'm not sure how your API message is styled, but if it's html directly injected by the api, that will definitely use the server.
1763402720
Jiboux
Pro
Sheet Author
Compendium Curator
The API injects HTML in the chat, with styles coming from the sheet CSS. It worked fine up to now and there are other images (icons) that do work. But this one particular image doesn’t load just for the API and not the sheet, and by using the inspector I could see the URL for the API was different than the one I have directly in the CSs ( prefixed with the roll20 imgsrv, instead of referencing directly GitHub… any idea how I could fix it ?
1763403636
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
How is the sheet css affecting the api message? Unless something was going wrong with the sanitization, the sheet css should only be able to affect rolltemplate output, not anything created directly by the api.
1763414715
Jiboux
Pro
Sheet Author
Compendium Curator
Hello Scott, The API is creating its own "pseudo roll templates" and sending them to the chat via message. They are formatted in HTML, but have style proceeding from the sheet CSS. Here is an extract of the CSS with the style that wraps such a template, but also for reference the one that displays the first icon in the screen capture. The 2 screen captures are: -How it should look ( with the border-image ) -How it actually looks ( the border-image doesn't display, but the icons that reference the images the exact same way do) Note that the icon on the left of the text that is declared in the same CSS is displayed in both screen captures, while the border doesn't display as of now, but I was able to have ti display by forcing the value of the border-image-source to the actiual value from the CSS instead of the one that seems to have been sanitized to prefix with the roll20 server .sheet-rolltemplate-sect { &nbsp; background-color:&nbsp; &nbsp; &nbsp;var( --bg-color); /*white;*/ &nbsp; padding:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11px; &nbsp; overflow:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hidden; &nbsp; /* width:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 90%; */ &nbsp; border-image-slice:&nbsp; &nbsp;50 66 50 66; &nbsp; border-image-width:&nbsp; &nbsp;8px 10px 8px 10px; &nbsp; border-image-outset:&nbsp; 0px 0px 0px 0px; &nbsp; border-image-repeat:&nbsp; round round; &nbsp; border-image-source:&nbsp; url("<a href="https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%20%28FASA%20Official%29/Images/ED-ExternalFrame.png?raw=true" rel="nofollow">https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%20%28FASA%20Official%29/Images/ED-ExternalFrame.png?raw=true</a>"); } .sheet-rolltemplate-icons-action, .sheet-icon-action&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ content: url(<a href="https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%20%28FASA%20Official%29/Images/Action.png" rel="nofollow">https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Earthdawn%20%28FASA%20Official%29/Images/Action.png</a>); }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*License Information*/
1763414776
Jiboux
Pro
Sheet Author
Compendium Curator
The "first screen capture" didn't appear