{"id":31580385,"url":"https://github.com/franbarinstance/neutral-cache-test","last_synced_at":"2025-10-13T06:39:57.643Z","repository":{"id":278724530,"uuid":"936564969","full_name":"FranBarInstance/neutral-cache-test","owner":"FranBarInstance","description":"Rust template engine with cache and no cache - Neutral TS","archived":false,"fork":false,"pushed_at":"2025-04-25T13:49:05.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-10T21:58:54.149Z","etag":null,"topics":["cache-template","rust-template","rust-template-engine","rust-web-template","template","template-cache","web-template","web-templates"],"latest_commit_sha":null,"homepage":"https://FranBarInstance.github.io/neutralts/docs/neutralts/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FranBarInstance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-21T09:55:18.000Z","updated_at":"2025-07-10T09:08:43.000Z","dependencies_parsed_at":"2025-07-10T21:59:02.302Z","dependency_job_id":"f53b8ee7-4448-41b3-8227-e2bc30e644ef","html_url":"https://github.com/FranBarInstance/neutral-cache-test","commit_stats":null,"previous_names":["franbar1966/neutral-cache-test","franbarinstance/neutral-cache-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FranBarInstance/neutral-cache-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranBarInstance%2Fneutral-cache-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranBarInstance%2Fneutral-cache-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranBarInstance%2Fneutral-cache-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranBarInstance%2Fneutral-cache-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FranBarInstance","download_url":"https://codeload.github.com/FranBarInstance/neutral-cache-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranBarInstance%2Fneutral-cache-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278519918,"owners_count":26000384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache-template","rust-template","rust-template-engine","rust-web-template","template","template-cache","web-template","web-templates"],"created_at":"2025-10-05T21:11:46.195Z","updated_at":"2025-10-05T21:11:48.716Z","avatar_url":"https://github.com/FranBarInstance.png","language":"Rust","readme":"Rust template engine with cache and !cache\n==========================================\n\nExample of the Neutral TS cache in the terminal.\n\nDownload, navitate to neutral-cache-test directory and:\n\n```plaintext\ncargo run\n```\n\nArbitrary key/value arguments can be set:\n\n```plaintext\ncargo run -- --argname argvalue\ncargo run -- --argname \"arg value\"\n```\n\nThere is an argument (`inject`) designed to try to inject code:\n\n```plaintext\ncargo run -- --inject \"{:include; /path/to/secrets :}\"\n```\n\n`inject` has the default value `{:exit; 403 :}`, what happens if the injection succeeds can be tested with:\n\n```plaintext\ncargo run -- --exit 403\n```\n\nThe directory of the disk cache will be the temporary directory of the system, it can be changed in `main.rs` is indicated.\n\nCache\n-----\n\nThe cache is modular, allowing only parts of the template to be included in the cache:\n\n```plaintext\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eCache\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n\n        {:cache; /120/ \u003e\u003e\n            \u003cdiv\u003e{:code; ... :}\u003c/div\u003e\n        :}\n\n        \u003cdiv\u003e{:date; %H:%M:%S :}\u003c/div\u003e\n\n        {:cache; /120/ \u003e\u003e\n            \u003cdiv\u003e{:code; ... :}\u003c/div\u003e\n        :}\n\n    \u003c/body\u003e\n\u003c/html\u003e\n```\nOr exclude parts of the cache, the previous example would be much better like this:\n\n```plaintext\n{:cache; /120/ \u003e\u003e\n    \u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n        \u003chead\u003e\n            \u003ctitle\u003eCache\u003c/title\u003e\n        \u003c/head\u003e\n        \u003cbody\u003e\n            {:!cache;\n                {:date; %H:%M:%S :}\n            :}\n        \u003c/body\u003e\n    \u003c/html\u003e\n:}\n```\n\nOverview of cache syntax\n------------------------\n\n```plaintext\n{:cache; /expires/addtoid/only_custom_id/ \u003e\u003e ... :}\n{:cache; /expires/addtoid/ \u003e\u003e ... :}\n{:cache; /expires/ \u003e\u003e ... :}\n{:!cache; ... :}\n```\n\n* expires: Seconds of life in the cache\n* addtoid: Add a literal to the cache ID\n* only_custom_id: Use only the ID passed as ID\n\nThe only mandatory parameter is `expires`, the cache automatically generates an ID with context data, such as language, cookies, ... and code.\n\nExample\n-------\n\nThe example template is in the `neutral-cache-test/tpl` directory with the name `index.ntpl`, you can modify it as much as you want:\n\n```plaintext\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eTest Neutral TS cache\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n    \u003cpre\u003e\n        Outside cache : {:;CONTEXT-\u003eGET-\u003einject:} vs {:;inject:}\n        Outside filter: {:\u0026;CONTEXT-\u003eGET-\u003einject:} vs {:\u0026;inject:}\n    \u003c/pre\u003e\n    {:cache; /10/{:;inject:}/ \u003e\u003e\n        {:^filled; CONTEXT-\u003eGET-\u003eexit \u003e\u003e\n            {:exit; {:;CONTEXT-\u003eGET-\u003eexit:} :}\n        :}\n        {:^;:}\n        \u003cpre\u003e\n            Arguments:\n            {:each; CONTEXT-\u003eGET key val \u003e\u003e\n                {:^;:}\n                {:\u0026;key:} = {:;val:}\n                {:^;:}\n            :}\n            ----------------------------------------------------\n            Inject ....: {:;inject:} vs {:;CONTEXT-\u003eGET-\u003einject:}\n            In cache ..: {:date; %H:%M:%S :} (10)\n            No cache ..: {:!cache; {:date; %H:%M:%S :} (!) :}\n            Nesting ...: {:cache; /20/ \u003e\u003e\n                {:date; %H:%M:%S :} (20) / {:!cache; {:date; %H:%M:%S :} (!) :}\n            :}\n            Crazy .....: {:!cache;\n                {:cache; /30/ \u003e\u003e\n                    {:date; %H:%M:%S :} (30) / {:cache; /40/ \u003e\u003e\n                        {:date; %H:%M:%S :} (40) / {:cache; /50/ \u003e\u003e\n                            {:date; %H:%M:%S :} (50) ({:;inject:}) / {:!cache;\n                                {:date; %H:%M:%S :} (!) {:;inject:}\n                            :}\n                        :}\n                    :}\n                :}\n            :}\n        \u003c/pre\u003e\n    :}\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\nLinks\n-----\n- [Repository](https://gitlab.com/neutralfw/neutralts)\n- [Crate](https://crates.io/crates/neutralts)\n- [Docs](https://docs.rs/neutralts/latest/neutralts/doc/index.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranbarinstance%2Fneutral-cache-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranbarinstance%2Fneutral-cache-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranbarinstance%2Fneutral-cache-test/lists"}