Skip to content

Dont allow HTTP caching #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions code/KickAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public function handleIndex($r) {
return $this->handleSearch($r);
}

HTTP::set_cache_age(0);
return $this->renderWith('KickAssets');
}

Expand All @@ -153,6 +154,7 @@ public function handleIndex($r) {
* @return SS_HTTPResponse
*/
public function handleFolderContents(SS_HTTPRequest $r) {
HTTP::set_cache_age(0);
if(!$r->param('FolderID')) {
$folder = Injector::inst()->get('Folder');
$folder->Filename = ASSETS_DIR;
Expand Down Expand Up @@ -228,7 +230,8 @@ public function handleRecentItems(SS_HTTPRequest $r) {

}
}


HTTP::set_cache_age(0);
return (new SS_HTTPResponse(
Convert::array2json($result), 200
))->addHeader('Content-Type', 'application/json');
Expand Down Expand Up @@ -320,7 +323,8 @@ public function handleFolders(SS_HTTPRequest $r) {
'filename' => $f->Filename
);
}


HTTP::set_cache_age(0);
return (new SS_HTTPResponse(
Convert::array2json($response)
))->addHeader('Content-Type','application/json');
Expand Down