-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement first response parts of http caching * Implement cached response for static resources * Implement HTTP caching for json responses * Fix last seen value for online players * Implement http caching for pages (.html) * Use placeholder cache even with async requests. Affects issues: - Close #2813
- Loading branch information
Showing
42 changed files
with
700 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/ReactPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* This file is part of Player Analytics (Plan). | ||
* | ||
* Plan is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License v3 as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Plan is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Plan. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.djrapitops.plan.delivery.rendering.pages; | ||
|
||
import com.djrapitops.plan.delivery.web.resource.WebResource; | ||
import org.apache.commons.lang3.StringUtils; | ||
|
||
/** | ||
* Represents React index.html. | ||
* | ||
* @author AuroraLS3 | ||
*/ | ||
public class ReactPage implements Page { | ||
|
||
private final String basePath; | ||
private final WebResource reactHtml; | ||
|
||
public ReactPage(String basePath, WebResource reactHtml) { | ||
this.basePath = basePath; | ||
this.reactHtml = reactHtml; | ||
} | ||
|
||
@Override | ||
public String toHtml() { | ||
return StringUtils.replace( | ||
reactHtml.asString(), | ||
"/static", basePath + "/static"); | ||
} | ||
|
||
@Override | ||
public long lastModified() { | ||
return reactHtml.getLastModified().orElseGet(System::currentTimeMillis); | ||
} | ||
} |
Oops, something went wrong.