* fix: update instead of extend
None of these are supposed to be extended over defaults.
* feat: custom response header support
* refactor: use response_headers to set cache control headers
* feat: Decorator to cache API response using cache-control headers
* perf: cache notifications for 1 minute
+ SWR for 5 minutes
* perf: cache `get_events` on desk load
* perf: slow down auto-refresh even more
once every 5 seconds instead of 2 seconds.
* perf: Cache plain link validation for 30 minutes
Very often you're picking same documents again and again, there's no
need to validate them.
Also, document is JUST selected using search_link, so it's 99%
guaranteed to be valid.
The real purpose of this function is to provide "fetch from" feature,
not link validation like the name suggests.
It will get validated server side anyway.
* fix: Never use HTTP cache in developer mode
* perf: cache "is_document_amended"
A document that is amended from something stays amended.
* perf: proxy-cache website_script.js
* fix: only cache if called directly
Very often you're picking same documents again and again, there's no
need to validate them.
Also, document is JUST selected using search_link, so it's 99%
guaranteed to be valid.
The real purpose of this function is to provide "fetch from" feature,
not link validation like the name suggests.
It will get validated server side anyway.
* fix: remove whitespace in restrict ip in validate
* fix: added check for request_ip
* fix: return if no restrict ip
* fix: set to localhost if none, refactor validate_ip_addr
* fix: validate ip_address cleanup and removed uncessary comments
* fix: validate ip_addr cleanup
* fix: remove unecessary check
This broke for some cases because people had doc permissions, but `has_website_permission()` returns False
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This allows for caching the count which are frequently requested but
rarely change and even if they changed, UI doesn't show accurate value
to begin with.
After this change any filters that result in "1,000+" response will be
just cached by client and won't be requested again and again (for at
least 30 minutes, it's SWR after that so UI should still be snappy)
* refactor: Trim `__init__.py`
We strayed from the goal here: https://github.com/frappe/frappe/pull/29181
So making up for it.
* chore!: Delete unused get_version
Not used anywhere
* refactor: move few more functions to relevant place
* asd
* perf: faster `LocalProxy`
* refactor: use callable style local
* test: add some tests for local proxy override
---------
Co-authored-by: Ankush Menat <ankush@frappe.io>