{"id":19083439,"url":"https://github.com/emrd/cache-management-nodejs","last_synced_at":"2025-11-12T00:31:23.800Z","repository":{"id":252067054,"uuid":"839302656","full_name":"EmrD/cache-management-nodejs","owner":"EmrD","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-07T11:49:59.000Z","size":986,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T06:26:11.507Z","etag":null,"topics":["cache","cache-control","management","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EmrD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-08-07T10:38:27.000Z","updated_at":"2024-08-19T13:44:22.000Z","dependencies_parsed_at":"2024-08-07T14:26:46.699Z","dependency_job_id":"7adf3048-ef23-4a38-8a18-3467b4e239b9","html_url":"https://github.com/EmrD/cache-management-nodejs","commit_stats":null,"previous_names":["emrd/cache-management-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EmrD/cache-management-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Fcache-management-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Fcache-management-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Fcache-management-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Fcache-management-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EmrD","download_url":"https://codeload.github.com/EmrD/cache-management-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Fcache-management-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283956244,"owners_count":26922671,"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-11-11T02:00:06.610Z","response_time":65,"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","cache-control","management","nodejs"],"created_at":"2024-11-09T02:47:29.888Z","updated_at":"2025-11-12T00:31:23.785Z","avatar_url":"https://github.com/EmrD.png","language":"JavaScript","readme":"# Cache-NodeJS\r\n\r\nThis project is a basic Node.js API example using Express and NodeCache for caching responses and measuring response times.\r\n\r\n## Features\r\n\r\n- **Caching:** Caches server responses and serves them quickly from the cache.\r\n- **Response Time Measurement:** Measures the time taken for each response from the server.\r\n\r\n## Installation\r\n\r\nSteps to set up and run the project:\r\n\r\n1. **Clone the repository:**\r\n    ```sh\r\n    git clone \u003cREPO_URL\u003e\r\n    cd \u003cFOLDER_NAME\u003e\r\n    ```\r\n\r\n2. **Install the required dependencies:**\r\n    ```sh\r\n    npm install\r\n    ```\r\n\r\n3. **Start the server:**\r\n    ```sh\r\n    node index.js\r\n    ```\r\n\r\n## Usage\r\n\r\nOnce the server is running, you can test the API using the following URL:\r\n\r\n- **Data Request:** `GET http://localhost:3000/data`\r\n\r\n    ```sh\r\n    curl http://localhost:3000/data\r\n    ```\r\n\r\n    Example response (from server):\r\n    ```json\r\n    {\r\n      \"message\": \"This data is coming from the server\",\r\n      \"timestamp\": \"2024-08-07T10:32:43.379Z\",\r\n      \"cache\": false,\r\n      \"responseTime\": 1\r\n    }\r\n    ```\r\n\r\n    Example response (from cache):\r\n    ```json\r\n    {\r\n      \"message\": \"This data is coming from the server\",\r\n      \"timestamp\": \"2024-08-07T10:32:43.379Z\",\r\n      \"cache\": true,\r\n      \"responseTime\": 0\r\n    }\r\n    ```\r\n\r\n## Middlewares\r\n\r\n### checkCache\r\n\r\nThis middleware checks if the incoming request is present in the cache. If found, it returns the response from the cache; otherwise, it moves to the next middleware.\r\n\r\n### measureResponseTime\r\n\r\nThis middleware measures the response time for each request and adds it to the response object.\r\n\r\n## Contributing\r\n\r\nFeel free to submit a pull request or open an issue to contribute to this project. Contributions are welcome.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrd%2Fcache-management-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrd%2Fcache-management-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrd%2Fcache-management-nodejs/lists"}