|
From: Gustaf N. (sslmail) <ne...@wu...> - 2025-09-19 15:16:10
|
i think, i’ve missed the following posting: > The only thing to figure out for us, is the “untrusted” https domains we host (we have a *.decentespresso.com <http://decentespresso.com/> ssl cert) and that looks like a config change, as the warnings indicate. based on the provided host header field, NaviServer decides to which virtual server configuration (and with this, which blueprint etc.) the requests should be routed. One has to define the “defaultserver” for undecided cases. Checkout [1] for the documentation. Note that the host header field is subject to various attacks, since it is also used for redirects, the server might be used as a gateway. If you are cautious, you can consider to define a defaultserver as a honeypot and use just trusted headerfields for your real site. HTTP/3 will be a little be better in this respect. > > And I believe that ns_cache is now deprecated, so I should look at replacing that. I make heavy use of this: > > proc content_cache {cachename codetorun} { > if {[cookie_get "decent_admin"] != "" || [decentliveserver] == 0} { > return [eval $codetorun] > } > > return [ns_cache_eval tempfile $cachename $codetorun] > } ns_cache is not deprecated. If you have a source claiming otherwise, it should be corrected. In fact, ns_cache provides a unique transaction feature that can be linked to database transactions. This ensures consistency between cached values and the database state. By contrast, traditional caches retain intermediate results even when a complex transaction fails, leaving the cache out of sync with the database. Such inconsistencies can cause elusive “Heisenbugs” that are extremely difficult to diagnose. Caching entire content pages is generally not recommended, especially when pages are personalized, since cache reuse is typically poor. Instead, I suggest setting a maxentry value to prevent a single large page from evicting the entire cache. It is also good practice to monitor the cache statistics in nsstats to evaluate how well your caching parameters perform — paying attention to metrics such as cache reuse and mutex contention. > on pages that use big mysql queries to render. > > Anything else big in navi5 that I should jump on? it depepends, from where you jump. [1] https://naviserver.sourceforge.io/5/manual/files/admin-config.html#subsection7 > > -john > > _______________________________________________ > Naviserver-users mailing list > Nav...@li... <mailto:Nav...@li...> > https://lists.sourceforge.net/lists/listinfo/naviserver-users |