from django.shortcuts import render

from normandy.base.decorators import short_circuit_middlewares


@short_circuit_middlewares
def repair(request, locale):
    return render(request, 'selfrepair/repair.html', {
        'locale': locale,
    })

from django.conf import settings
from django.shortcuts import render
from django.views.decorators.cache import cache_control

from normandy.base.decorators import short_circuit_middlewares


@short_circuit_middlewares
@cache_control(public=True, max_age=settings.API_CACHE_TIME)
def repair(request, locale):
    return render(request, 'selfrepair/repair.html', {
        'locale': locale,
    })

Add cache headers to self-repair page
Add cache headers to self-repair page

+ from django.conf import settings
  from django.shortcuts import render
+ from django.views.decorators.cache import cache_control
  
  from normandy.base.decorators import short_circuit_middlewares
  
  
  @short_circuit_middlewares
+ @cache_control(public=True, max_age=settings.API_CACHE_TIME)
  def repair(request, locale):
      return render(request, 'selfrepair/repair.html', {
          'locale': locale,
      })
  
Add cache headers to self-repair page
## Code Before:
from django.shortcuts import render

from normandy.base.decorators import short_circuit_middlewares


@short_circuit_middlewares
def repair(request, locale):
    return render(request, 'selfrepair/repair.html', {
        'locale': locale,
    })

## Instruction:
Add cache headers to self-repair page
## Code After:
from django.conf import settings
from django.shortcuts import render
from django.views.decorators.cache import cache_control

from normandy.base.decorators import short_circuit_middlewares


@short_circuit_middlewares
@cache_control(public=True, max_age=settings.API_CACHE_TIME)
def repair(request, locale):
    return render(request, 'selfrepair/repair.html', {
        'locale': locale,
    })
