A simple caching system built with PHP and JSON, featuring a user-friendly web interface.
This system allows you to temporarily store data in server memory with expiration times (TTL). Perfect for beginners learning web development and APIs.
- ✅ Store data with time-to-live (TTL) expiration
- ✅ Simple RESTful API
- ✅ Arabic user-friendly web interface
- ✅ JSON file-based storage
- ✅ Basic CRUD operations support
│ ├── 📄 index.php # Main user interface ├── 📄 api.php # API endpoints ├── 📄 cache.php # Caching system core ├── 📄 cache_data.json # Data storage file (auto-generated)
- Web server (XAMPP, WAMP, or MAMP)
- PHP 7.0 or newer
- Modern web browser
- Copy all files to your web server directory: C:\xampp\htdocs\caching-system\
- Start your web server
- Open your browser and navigate to: http://localhost/caching-system/index.php
- Open
index.phpin your browser - Use the buttons to manage data:
- Add Data: Fill fields and click "Save Data"
- Retrieve Data: Enter key and click "Retrieve Data"
- Update Data: Fill fields and click "Update Data"
- Delete Data: Enter key and click "Delete Data"
POST http://localhost/caching-system/api.php
Content-Type: application/json
{
"key": "username",
"value": "Ahmed",
"ttl": 60
}
#### 2. Retrieve Data (GET)
GET http://localhost/caching-system/api.php?key=username
#### 3. Update Data (PUT)
PUT http://localhost/caching-system/api.php
Content-Type: application/json
{
"key": "username",
"value": "Ahmed Updated",
"ttl": 120
}
#### 4. Delete Data (DELETE)
DELETE http://localhost/caching-system/api.php?key=username
{
"message": "Key username set with value Ahmed"
}