Skip to content

Commit 2c8910b

Browse files
Update Cache-Control header to prevent caching (#1091)
1 parent 3236cd3 commit 2c8910b

File tree

11 files changed

+374
-21
lines changed

11 files changed

+374
-21
lines changed

.serena/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/cache
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Code Style and Conventions
2+
3+
## Language and Configuration
4+
5+
- **TypeScript**: Strict mode enabled with comprehensive type checking
6+
- **Module System**: ESNext with NodeNext module resolution
7+
- **Target**: ESNext for modern JavaScript features
8+
9+
## Code Quality Tools
10+
11+
- **Biome**: Used for linting, formatting, and code quality
12+
- Configuration extends `@arthurfiorette/biomejs-config`
13+
- Excludes build directories, dist, dev, coverage, node_modules
14+
- **TypeScript**: Strict configuration with all strict flags enabled
15+
16+
## TypeScript Configuration Highlights
17+
18+
- `strict: true` - All strict type checking enabled
19+
- `noImplicitAny: true`
20+
- `strictNullChecks: true`
21+
- `noUnusedLocals: true`
22+
- `noUnusedParameters: true`
23+
- `noImplicitReturns: true`
24+
- `noUncheckedIndexedAccess: true`
25+
- `verbatimModuleSyntax: true`
26+
27+
## File Structure Conventions
28+
29+
- Use `.ts` extensions for TypeScript files
30+
- Use `.js` extensions in import statements (for ESM compatibility)
31+
- Mirror test file structure with source files
32+
- Use kebab-case for file names when multiple words
33+
34+
## Import/Export Conventions
35+
36+
- Use named exports primarily
37+
- Main `index.ts` re-exports all public APIs
38+
- Use `.js` extensions in imports (transpiled to correct format)
39+
40+
## Development Build Support
41+
42+
- Uses `__ACI_DEV__` global constant for development-specific code
43+
- Development builds include console warnings
44+
- Production builds strip development code
45+
46+
## Code Organization
47+
48+
- Modular architecture with clear separation of concerns
49+
- Each module has its own directory with related types
50+
- Utilities are separated into dedicated util modules
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Codebase Structure
2+
3+
## Root Directory
4+
5+
- `src/` - Main source code
6+
- `test/` - Test files (mirrors src structure)
7+
- `docs/` - VitePress documentation
8+
- `examples/` - Usage examples
9+
- `benchmark/` - Performance benchmarks
10+
- `build.sh` - Custom build script
11+
- `package.json` - Project configuration
12+
- `biome.json` - Code quality configuration
13+
- `tsconfig.json` - TypeScript configuration
14+
15+
## Source Code Structure (`src/`)
16+
17+
### Core Modules
18+
19+
- `index.ts` - Main entry point (exports all modules)
20+
- `cache/` - Core caching functionality
21+
- `axios.ts` - Axios integration
22+
- `cache.ts` - Cache implementation
23+
- `create.ts` - Cache creation utilities
24+
- `interceptors/` - Request/response interceptors
25+
- `request.ts` - Request interceptor logic
26+
- `response.ts` - Response interceptor logic
27+
- `build.ts` - Interceptor building utilities
28+
- `util.ts` - Interceptor utilities
29+
- `storage/` - Storage adapters
30+
- `memory.ts` - In-memory storage
31+
- `web-api.ts` - Web API storage (localStorage, etc.)
32+
- `build.ts` - Storage building utilities
33+
- `types.ts` - Storage type definitions
34+
- `header/` - HTTP header handling
35+
- `headers.ts` - Header utilities
36+
- `interpreter.ts` - Cache header interpretation
37+
- `types.ts` - Header type definitions
38+
- `util/` - General utilities
39+
- `cache-predicate.ts` - Cache condition checking
40+
- `key-generator.ts` - Cache key generation
41+
- `update-cache.ts` - Cache updating logic
42+
- `types.ts` - Utility type definitions
43+
44+
## Test Structure (`test/`)
45+
46+
- Mirrors the `src/` directory structure
47+
- Uses Node.js built-in test runner
48+
- Includes mock utilities in `test/mocks/`
49+
- Setup file: `test/setup.js`
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Axios Cache Interceptor - Project Overview
2+
3+
## Purpose
4+
5+
Axios Cache Interceptor is a cache interceptor for axios designed with developers and performance in mind. It allows developers to call axios multiple times without worrying about overloading the network or implementing a simple and buggy cache system themselves.
6+
7+
## Key Features
8+
9+
- ⚡ Performance optimized
10+
- 📦 Multiple build targets (ESM, CJS, UMD)
11+
- 🔩 Easy to use - just wrap your axios instance
12+
- 🛠️ Rich caching features (ETags, Last-Modified, Cache-Control, etc.)
13+
- 🌐 Reduces network waste through intelligent caching
14+
- 🔑 Full TypeScript support
15+
16+
## Tech Stack
17+
18+
- **Language**: TypeScript
19+
- **Package Manager**: pnpm (v9.1.1)
20+
- **Node Version**: >=12 (configured in .nvmrc)
21+
- **Build Tool**: microbundle (for multiple output formats)
22+
- **Code Quality**: Biome (linting, formatting, type checking)
23+
- **Testing**: Node.js built-in test runner with c8 for coverage
24+
- **Documentation**: VitePress
25+
26+
## Basic Usage
27+
28+
```ts
29+
import Axios from 'axios';
30+
import { setupCache } from 'axios-cache-interceptor';
31+
32+
const instance = Axios.create();
33+
const axios = setupCache(instance);
34+
35+
const req1 = axios.get('https://arthur.place/');
36+
const req2 = axios.get('https://arthur.place/');
37+
38+
const [res1, res2] = await Promise.all([req1, req2]);
39+
40+
res1.cached; // false
41+
res2.cached; // true
42+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Suggested Commands
2+
3+
## Development Commands
4+
5+
### Code Quality
6+
7+
- `pnpm lint` - Check code quality with Biome
8+
- `pnpm lint-fix` - Fix code quality issues with Biome (including unsafe fixes)
9+
- `pnpm lint-ci` - Run linting for CI (strict mode)
10+
- `pnpm format` - Format code with Biome
11+
12+
### Testing
13+
14+
- `pnpm test` - Run all tests with coverage (using Node.js test runner + c8)
15+
- `pnpm test:only` - Run only tests marked with `test.only`
16+
- `pnpm test:types` - Run TypeScript type checking
17+
18+
### Building
19+
20+
- `pnpm build` - Build the project (runs build.sh script)
21+
- `bash build.sh` - Direct build script execution
22+
23+
### Documentation
24+
25+
- `pnpm docs:dev` - Start development documentation server (port 1227)
26+
- `pnpm docs:build` - Build documentation
27+
- `pnpm docs:serve` - Serve built documentation
28+
29+
### Other
30+
31+
- `pnpm benchmark` - Run performance benchmarks
32+
- `pnpm version` - Update version and changelog
33+
34+
## Build Outputs
35+
36+
- `dist/` - Production builds (multiple formats: ESM, CJS, Modern, UMD)
37+
- `dev/` - Development builds with debug information
38+
- Both include TypeScript declaration files
39+
40+
## Package Manager
41+
42+
- Uses **pnpm** as the package manager
43+
- Version: 9.1.1 (specified in packageManager field)
44+
45+
## Node Version
46+
47+
- Minimum: Node.js >=12
48+
- Uses `.nvmrc` for version specification
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# System Utilities and Environment
2+
3+
## System Information
4+
5+
- **Platform**: Linux
6+
- **OS**: Linux 5.15.133.1-microsoft-standard-WSL2 (WSL2 environment)
7+
- **Shell**: Bash
8+
9+
## Available System Commands
10+
11+
- `git` - Git version control
12+
- `ls` - List directory contents
13+
- `cd` - Change directory
14+
- `find` - Find files and directories
15+
- `grep` - Search text patterns
16+
- `bash` - Execute bash scripts
17+
- `node` - Node.js runtime
18+
- `pnpm` - Package manager
19+
20+
## Git Information
21+
22+
- **Current Branch**: arthurfiorette/safari-takeover
23+
- **Main Branch**: main (use for PRs)
24+
- **Status**: Clean working directory
25+
26+
## Project Environment
27+
28+
- **Working Directory**: /home/hzk/dev/axios-cache-interceptor
29+
- **Git Repository**: Yes
30+
- **Package Manager**: pnpm (version 9.1.1)
31+
- **Node Version**: >=12 (specified in package.json engines)
32+
33+
## Special Considerations for Linux/WSL2
34+
35+
- File permissions may need attention
36+
- Cross-platform compatibility is maintained in build scripts
37+
- Uses Unix-style line endings (`newLine: "lf"` in tsconfig)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Task Completion Workflow
2+
3+
## Commands to Run After Completing Tasks
4+
5+
### Code Quality Checks (Required)
6+
7+
1. `pnpm lint` - Check for linting issues
8+
2. `pnpm lint-fix` - Auto-fix linting issues (if needed)
9+
3. `pnpm test:types` - Verify TypeScript type checking passes
10+
11+
### Testing (Required)
12+
13+
4. `pnpm test` - Run all tests with coverage to ensure nothing is broken
14+
15+
### Build Verification (When Applicable)
16+
17+
5. `pnpm build` - Verify the build process works correctly (when changes affect build)
18+
19+
### Documentation (When Applicable)
20+
21+
6. `pnpm docs:build` - Verify documentation builds correctly (when docs are modified)
22+
23+
## Workflow Order
24+
25+
1. **First**: Fix any linting issues with `pnpm lint-fix`
26+
2. **Second**: Ensure types are correct with `pnpm test:types`
27+
3. **Third**: Run tests to verify functionality with `pnpm test`
28+
4. **Fourth**: Build if necessary with `pnpm build`
29+
5. **Finally**: Check documentation builds if docs were modified
30+
31+
## Pre-commit Considerations
32+
33+
- The project uses strict TypeScript configuration
34+
- All tests must pass
35+
- Code must pass linting
36+
- Type checking must pass
37+
- Build must succeed for production releases
38+
39+
## Development vs Production
40+
41+
- Development builds include debug information via `__ACI_DEV__` flag
42+
- Production builds strip debug code for optimal performance
43+
- Both are built simultaneously by the build script

.serena/project.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
2+
# * For C, use cpp
3+
# * For JavaScript, use typescript
4+
# Special requirements:
5+
# * csharp: Requires the presence of a .sln file in the project folder.
6+
language: typescript
7+
8+
# whether to use the project's gitignore file to ignore files
9+
# Added on 2025-04-07
10+
ignore_all_files_in_gitignore: true
11+
# list of additional paths to ignore
12+
# same syntax as gitignore, so you can use * and **
13+
# Was previously called `ignored_dirs`, please update your config if you are using that.
14+
# Added (renamed) on 2025-04-07
15+
ignored_paths: []
16+
17+
# whether the project is in read-only mode
18+
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
19+
# Added on 2025-04-18
20+
read_only: false
21+
22+
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
23+
# Below is the complete list of tools for convenience.
24+
# To make sure you have the latest list of tools, and to view their descriptions,
25+
# execute `uv run scripts/print_tool_overview.py`.
26+
#
27+
# * `activate_project`: Activates a project by name.
28+
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
29+
# * `create_text_file`: Creates/overwrites a file in the project directory.
30+
# * `delete_lines`: Deletes a range of lines within a file.
31+
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
32+
# * `execute_shell_command`: Executes a shell command.
33+
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
34+
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
35+
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
36+
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
37+
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
38+
# * `initial_instructions`: Gets the initial instructions for the current project.
39+
# Should only be used in settings where the system prompt cannot be set,
40+
# e.g. in clients you have no control over, like Claude Desktop.
41+
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
42+
# * `insert_at_line`: Inserts content at a given line in a file.
43+
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
44+
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
45+
# * `list_memories`: Lists memories in Serena's project-specific memory store.
46+
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
47+
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
48+
# * `read_file`: Reads a file within the project directory.
49+
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
50+
# * `remove_project`: Removes a project from the Serena configuration.
51+
# * `replace_lines`: Replaces a range of lines within a file with new content.
52+
# * `replace_symbol_body`: Replaces the full definition of a symbol.
53+
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
54+
# * `search_for_pattern`: Performs a search for a pattern in the project.
55+
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
56+
# * `switch_modes`: Activates modes by providing a list of their names
57+
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
58+
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
59+
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
60+
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
61+
excluded_tools: []
62+
63+
# initial prompt for the project. It will always be given to the LLM upon activating the project
64+
# (contrary to the memories, which are loaded on demand).
65+
initial_prompt: ''
66+
67+
project_name: 'axios-cache-interceptor'

0 commit comments

Comments
 (0)