I have a request regarding the <include> tag to include other XML files into the ManiaLink: Enable caching for these ressources.
A possible use case for this would be to extract static content to a separate file, and to <include> it into the main ManiaLink. Such static content could be a ManiaScript (or parts of it) which will never change, or the menu of the ManiaLink etc.
Currently, Maniaplanet will re-request all <include>s when the ManiaLink is changed (or refreshed), so all static contents get re-downloaded to the client.
My suggestion is to add an attribute "timeout" to the <include>, which specifies the lifetime of the content in seconds (kinda like the <timeout> tag of the main ManiaLink). If missing, cache is disabled for this <include> to keep backward compatibility.
[Done] Make <include> cachable
Moderator: NADEO
Re: [Suggestion] Make <include> cachable
If you have an <timeout> in your included file, I think it already does this.
This is from an old archived post:
This is from an old archived post:
gouxim wrote:In a manialink, you can use the <timeout> tag to tell the ManiaPlanet client to cache that ressource on the client-side. Unfortunately, you cannot do that on includes. It may have a good impact on rendering time of pages since you won't need to wait for the cached-URLs to respond (remember that otherwise you need to execute the page request first, then get the result and parse it, then require the includes).
Some use cases:
* Include big chunks of static content on every page (for instance we include that file on each and every page of our Manialinks: https://code.google.com/p/manialib/sour ... nialib.xml)
* Include chunks of dynamic content, bug cache that content for a certain amount of time to avoid doing the request several times.
Edit: it is actually already working, thanks to gugli for pointing that outYou just need to place a timeout tag in your included file. However you need your XML to be valid, so put everything inside a root <frame> tag. Example: https://code.google.com/p/manialib/sour ... nialib.xml
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 

Re: [Suggestion] Make <include> cachable
I did a quick test, and including a <timeout> in the included file seems to work as intended: The file gets cached and re-requested after the specified timeout.
Thanks for the information
Thanks for the information

Who is online
Users browsing this forum: No registered users and 1 guest