mmd123 / squid-cache-dynamic_refresh-list

list of dynamic_refresh patterns to use with squid3, I had a hard time finding things online, so I figured I'd make a collaborative github repo for just this purpose
8 stars 4 forks source link

.js showing multiple times #14

Open JonathanDLee24 opened 1 year ago

JonathanDLee24 commented 1 year ago

Hello, I noticed that I am having issues with time cards and websites that use .js they are only loading the old version after 3 months they load a new one. I started to look at the code and notice that there is 5 different entries for js. What should be the correct version?

Lines: 193 70 29 24 18

Screen Shot 2022-10-20 at 7 31 52 PM Screen Shot 2022-10-20 at 7 31 39 PM Screen Shot 2022-10-20 at 7 31 32 PM
JonathanDLee24 commented 1 year ago

refresh_pattern -i (.|-)(xml|js|jsp|txt|css|swf|html|htm|txt|gif|tiff)(\?.*)?$ 360 80% 1440

if tested on https://regexr.com/37i6s will account for all of the repeated

What do you guys think?

ageekhere commented 1 year ago

Looks good, there are a lot of repeating entries with different options. Submit a pull request with your changes.

mmd123 commented 2 months ago

sorry, I only just now noticed this old issue post from 2022, I have tried to fix this by way of the suggested fix, please let me know if I have messed something up in the process, I'm far from fluent in this and really only made this GitHub repo to try and combine the collective efforts myself and MOSTLY ageekhere had been doing into a single effort, also far from fluent in using GitHub for managing things, so please tell me if I have messed something up in the process.

ageekhere commented 2 months ago

@mmd123 Remember to run squid -k in the console to check for errors You have some errors in your updated list

2024/07/07 09:32:33| /usr/local/etc/squid/squid.conf line 64: refresh_pattern -i (.|-)(xml|js|jsp|txt|css|swf|html|htm|txt|gif|tiff)(?.*)?$ 360 80% 1440              # JS
2024/07/07 09:32:33| refreshAddToList: Invalid regular expression '(.|-)(xml|js|jsp|txt|css|swf|html|htm|txt|gif|tiff)(?.*)?$': repetition-operator operand invalid
2024/07/07 09:32:33| refreshAddToList: Unknown option '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': 10080
2024/07/07 09:32:33| refreshAddToList: Unknown option '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': 80%
2024/07/07 09:32:33| refreshAddToList: Unknown option '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': 43200
2024/07/07 09:32:33| /usr/local/etc/squid/squid.conf line 151: refresh_pattern -i .(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf) 10080 80% 43200 10080 80% 43200
2024/07/07 09:32:33| refreshAddToList: Invalid regular expression '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': trailing backslash (\)

We also have some old errors as well.

2024/07/07 09:32:32| UPGRADE WARNING: 'cafile=/usr/local/share/certs/ca-root-nss.crt' is deprecated in http_port. Use 'tls-cafile=' instead.
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_DH_USE
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_ECDH_USE
2024/07/07 09:32:33| ERROR: Directive 'dns_v4_first' is obsolete.
2024/07/07 09:32:33| dns_v4_first : Remove this line. Squid no longer supports preferential treatment of DNS A records.
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_DH_USE
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_ECDH_USE

Will have a look to see if i can fix some of them

mmd123 commented 2 months ago

@mmd123 Remember to run squid -k in the console to check for errors You have some errors in your updated list

2024/07/07 09:32:33| /usr/local/etc/squid/squid.conf line 64: refresh_pattern -i (.|-)(xml|js|jsp|txt|css|swf|html|htm|txt|gif|tiff)(?.*)?$ 360 80% 1440              # JS
2024/07/07 09:32:33| refreshAddToList: Invalid regular expression '(.|-)(xml|js|jsp|txt|css|swf|html|htm|txt|gif|tiff)(?.*)?$': repetition-operator operand invalid
2024/07/07 09:32:33| refreshAddToList: Unknown option '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': 10080
2024/07/07 09:32:33| refreshAddToList: Unknown option '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': 80%
2024/07/07 09:32:33| refreshAddToList: Unknown option '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': 43200
2024/07/07 09:32:33| /usr/local/etc/squid/squid.conf line 151: refresh_pattern -i .(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf) 10080 80% 43200 10080 80% 43200
2024/07/07 09:32:33| refreshAddToList: Invalid regular expression '.(video-lax\d\-\d\.xx|video\.ak)\.fbcdn.net.*\.(mp4|flv|mp3|amf)': trailing backslash (\)

We also have some old errors as well.

2024/07/07 09:32:32| UPGRADE WARNING: 'cafile=/usr/local/share/certs/ca-root-nss.crt' is deprecated in http_port. Use 'tls-cafile=' instead.
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_DH_USE
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_ECDH_USE
2024/07/07 09:32:33| ERROR: Directive 'dns_v4_first' is obsolete.
2024/07/07 09:32:33| dns_v4_first : Remove this line. Squid no longer supports preferential treatment of DNS A records.
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_DH_USE
2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_ECDH_USE

Will have a look to see if i can fix some of them

well crap. to be fair, I moved about this time last year and still am only just now getting close to having the electrical work done to be able to turn pfsense on again, so I have, for now, no way to test that, should have thought that through before pushing a change to try and fix an old issue with no way to test, however hindsight 20/20 as they say, I did not think that through.

JonathanDLee24 commented 2 months ago

2024/07/07 09:32:33| dns_v4_first : Remove this line. Squid no longer supports preferential treatment of DNS A records. 2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_DH_USE 2024/07/07 09:32:33| ERROR: Unsupported TLS option SINGLE_ECDH_USE

This is standard now that is outdated