It is currently October 22nd, 2021, 10:48 am

WebParser measure ignores UserAgent, Header, Flags options with Download=1

Report bugs with the Rainmeter application and suggest features.
nek
Posts: 47
Joined: November 3rd, 2019, 12:00 am

WebParser measure ignores UserAgent, Header, Flags options with Download=1

Post by nek »

Hi Developers.

WebParser measure ignores UserAgent, Header, Flags options with Download=1.
This is not a big issue, but I would like to know if this is the expected behavior.

skinpreview.png

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1

[Variables]
URL=http://builds.rainmeter.net/

[MeasureWebParser]
Measure=WebParser
URL=#URL#
Download=1
DownloadFile=temp.txt
Flags=Resync | NoCookies
Header=Cache-Control: no-store
Header2=DNT: 1
Header3=Connection: close
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0

[MeterString1]
Meter=String
Text=Onett
Antialias=1
SolidColor=333333FF
FontColor=FFFFFFFF
FontSize=16
Padding=4,0,4,0
HTTP Request header - WebParser measure option Download=0, This works.
download0.png
HTTP Request header - WebParser measure option Download=1, The options are not applied.
download1.png
Accept-Encoding: gzip, deflate is great for downloading files.

Rainmeter log - WebParser measure option Download=1
> [Manage Rainmeter] window > [Settings] tab > [x] Debug mode
download1-rmlog.png
Rainmeter log says: Useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0" with WebParser measure option Download=1,
but it is different from the User-Agent that a network packet analyzer recorded.



My goal is - Downloading about 20 image files from a web server using webparser measure on every 10 minutes.
1. Reduce the network usage. 2. Reduce a response time of a WebParser.
My problem is - WebParser measure ignores Flags=Resync option when Download=1 is set.
So WebParser force download the same files even if the files are not modified, the cache files are not used.
WebParser cache location: %LOCALAPPDATA%\Microsoft\Windows\INetCache
Rainmeter Docs wrote:Flags=Resync: Only downloads if the resource has been modified since the last time it was downloaded. Otherwise the cache is used. This is the default if no Flags are set.

Code: Select all

Rainmeter 4.5.4.3550 (64-bit)
Language: English (1033)
Build time: 2021-10-04  9:25:19
Windows 10 Pro 1909 64-bit (build 18363) - Japanese (1041)
Path: Z:\Apps\Rainmeter\
SkinPath: Z:\Apps\Rainmeter\Skins\
SettingsPath: Z:\Apps\Rainmeter\
IniFile: Z:\Apps\Rainmeter\Rainmeter.ini


Edited: Oct. 13, 2021
MeasureWebParser.cpp wrote: https://github.com/rainmeter/rainmeter/blob/master/Library/MeasureWebParser.cpp#L1025

// Delete IE cache before download if "SyncMode5" is not 3 (every visit to the page)
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
There isn't registry entry named SyncMode5 in my Windows 10.
I don't understand C++ codes but It seems that the WebParser is designed to force download files when Download=1.


WebParser Flags option - Rainmeter Docs
rainmeter/Library/MeasureWebParser.cpp - GitHub
HTTP headers - MDN Web Docs
You do not have the required permissions to view the files attached to this post.